Hello dear Stackoverflow community,
i've meet following Scenario which appears to not work properly.
I have an Model called Principal
Inside the Model, i have the following property
protected Pages|null $storage = null;
And the following functions:
public function getStorage(): Pages|null
{
return $this->storage;
}
public function setStorage(Pages|null $storage): void
{
$this->storage = $storage;
}
With the following TCA Entry for that Database column:
'storage' => [
'label' => 'Mandanten Ordner',
'config' => [
'type' => 'group',
'internal_type' => 'db',
'allowed' => 'pages',
'foreign_table' => 'pages',
'foreign_field' => 'uid',
'minitems' => 1,
'suggestOptions' => [
'default' => [
'minimumCharacters' => 1,
'searchWholePhrase' => true
],
],
'fieldControl' => [
'addRecord' => [
'options' => [
'title' => 'Neu anlegen',
],
]
]
],
],
and db column:
storage int(11) DEFAULT '0' NOT NULL,
i created a Pages Model, for which i have Configured a Classes.php under Configuration->Extbase->Persistence. The Configuration was the following:
\MyVendor\MyExtensionKey\Domain\Model\Pages::class => [
'tableName' => 'pages',
'recordType' => '0'
],
The Pages Model:
<?php
namespace MyVendor\MyExtensionKey\Domain\Model;
class Pages extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{
public function getPid(): int|null
{
return $this->pid;
}
public function setPid(int $pid): void
{
$this->pid = $pid;
}
}
but when i try to call the getStorage() function from my Principal Model, i always only get null returned even if the uid of the page is already saved to my Principal Model.
i am confused as i already did associate an Model of mine to another Table, it worked when i for example used the fe_user table and so on, but pages does not seems to work.
Is there another solution to my specific case or is this one of the limits that can't be fully implemented within a TYPO3 Extension?
recordType => 0, which is not an existing page type?