Actions
Bug #93911
openCannot strong-type properties when extending a domain model
Status:
Needs Feedback
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2021-04-13
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
10
PHP Version:
7.4
Tags:
Complexity:
Is Regression:
Sprint Focus:
Description
In the context of using Configuration/Extbase/Persistence/Classes.php
, Extbase allows to extend a domain model, e.g.:
namespace VENDOR\MyExt\Domain\Model; class User extends FrontendUser { /** * @var string */ protected $courseStudy; // getter/setter
Corresponding definition looks like:
return [ \TYPO3\CMS\Extbase\Domain\Model\FrontendUser::class => [ 'tableName' => 'fe_users', 'recordType' => '\TYPO3\CMS\Extbase\Domain\Model\FrontendUser', 'subclasses' => [ 'Tx_MyExt_User' => \VENDOR\MyExt\Domain\Model\User::class, ] ], \VENDOR\MyExt\Domain\Model\User::class => [ 'tableName' => 'fe_users', 'properties' => [ 'courseStudy' => [ 'fieldName' => 'tx_myext_course_study' ], ], ], ];
This way the mapping just works fine!
However if you strong type the property, then it doesn't work anymore:
namespace VENDOR\MyExt\Domain\Model; class User extends FrontendUser { /** * @var string */ protected string $courseStudy; // getter/setter
(mind the protected string
).
Actions