[TYPO3-mvc] Extbase performance issues
Oliver Klee
typo3-german-02 at oliverklee.de
Wed Jul 4 11:50:50 CEST 2012
Hi,
Am 04.07.2012 11:46, schrieb Alexander Dick:
> I have already tried that, but it leads to problems. If i remember
> correctly, I get an error when I try to access a property that has the
> lazy annotation.
The corresponding getter needs to be build in a special way (only for
n:1 or 1:1 relations, not for m:n or 1:n relations, i.e., not for
ObjectStorages):
/**
* Returns the teaser image.
*
* @return Tx_ExtbaseDam_Domain_Model_Dam the teaser image, will be NULL
if none has been set
*/
public function getTeaserImage() {
if ($this->teaserImage instanceof
Tx_Extbase_Persistence_LazyLoadingProxy) {
$this->teaserImage->_loadRealInstance();
}
return $this->teaserImage;
}
Hope this helps,
Oli
--
Certified TYPO3 Integrator | TYPO3 Security Team Member
More information about the TYPO3-project-typo3v4mvc
mailing list