Actions
Bug #99408
closed@Extbase\ORM\Lazy generate an error if I use type property
Start date:
2022-12-21
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
11
PHP Version:
8.0
Tags:
Complexity:
Is Regression:
Sprint Focus:
Description
If I try to use Lazy loading with a property like that :
/**
* @var ?Eventtype
* @Extbase\ORM\Lazy
*/
protected Eventtype $eventType;
Then I have this error message :
Cannot assign TYPO3\CMS\Extbase\Persistence\Generic\LazyLoadingProxy to property Site\SiteNews\Domain\Model\News::$eventType of type Site\SiteNews\Domain\Model\Eventtype
If I remove the type, then the error disappears :
/**
* @var ?Eventtype
* @Extbase\ORM\Lazy
*/
protected $eventType;
Updated by Florian Rival almost 2 years ago
Have to add the LazyLoadingProxy in types and then it works :
/**
* @var ?Eventtype
* @Extbase\ORM\Lazy
*/
protected LazyLoadingProxy|Eventtype|null $eventType = null;
You can close this issue.
Actions