mirror of
https://github.com/FriendsOfTYPO3/tea.git
synced 2024-11-22 13:36:13 +01:00
[CLEANUP] Make lazy-loading proxies visible via type annotations (#310)
Relates to #291
This commit is contained in:
parent
3939ad083e
commit
0816fad65b
1 changed files with 5 additions and 2 deletions
|
@ -25,7 +25,8 @@ class Tea extends AbstractEntity
|
|||
protected $description = '';
|
||||
|
||||
/**
|
||||
* @var \TYPO3\CMS\Extbase\Domain\Model\FileReference
|
||||
* @phpstan-var \TYPO3\CMS\Extbase\Domain\Model\FileReference|LazyLoadingProxy|null
|
||||
* @var \TYPO3\CMS\Extbase\Domain\Model\FileReference|null
|
||||
* @Lazy
|
||||
*/
|
||||
protected $image = null;
|
||||
|
@ -53,7 +54,9 @@ class Tea extends AbstractEntity
|
|||
public function getImage(): ?FileReference
|
||||
{
|
||||
if ($this->image instanceof LazyLoadingProxy) {
|
||||
$this->image = $this->image->_loadRealInstance();
|
||||
/** @var FileReference $image */
|
||||
$image = $this->image->_loadRealInstance();
|
||||
$this->image = $image;
|
||||
}
|
||||
|
||||
return $this->image;
|
||||
|
|
Loading…
Reference in a new issue