[TYPO3-mvc] Edit of @lazy property

Franz Koch typo3.RemoveForMessage at elements-net.de
Tue Nov 30 17:09:06 CET 2010


Hey,

> Interesting point. With value="{company.billingContact}" the selected
> value key will become "classname:uid", when company.billingContact is
> an lazy object, which will be the case, when it's not used before.
>
> So it would be better to return the uid only in default __toString()
> method. Otherwise we have to adapt much more code, I think.

That might also be the issue occuring if you try to use a lazyLoaded 
object as bound object to forms - there you currently lose the identity 
of the object (didn't check the code yet why that happens).

But I don't think we have to change the __toString method. For me it's 
more a question if at this point __toString() should be called at all, 
or better check for a method getIdentifer() and return that instead. A 
method like this would also be needed if you work with foreign objects 
that don't have a uid - so everywhere where we use ->getUid we should 
implement and use ->getIdentifer instead.
__toString() in my eyes should only be used if you try to use the object 
in a print context, not if you try to resolve a identity.

-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list