Verified Commit 25158a7d authored by Oliver Klee's avatar Oliver Klee
Browse files

[CLEANUP] Make lazy-loading proxies visible via type annotations

Relates to #291
parent 4bde411d
......@@ -25,7 +25,7 @@ class Tea extends AbstractEntity
protected $description = '';
/**
* @var \TYPO3\CMS\Extbase\Domain\Model\FileReference
* @var \TYPO3\CMS\Extbase\Domain\Model\FileReference|LazyLoadingProxy
* @Lazy
*/
protected $image = null;
......@@ -53,7 +53,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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment