[TYPO3-mvc] Limit the "depht" of object relations

Jan Kornblum jan.kornblum at gmx.de
Fri Jun 28 10:35:46 CEST 2013


Hi Frenck,

thanks again :)

>> A last question about "[...] causes Extbase to load the objects and
>> build only when they are actually needed [...]": What happens when i
>> ::var_dump() an object with lazy-annotated childs, are the childs
>> "needed" in this case just because the var_dump call (without var_dump
>> the code itself wouldn't need them, for example)?
>
> Try it out. ;-)
>
> //var_dump($object,$object);
> var_dump($object); //any of the lazy proxies contain the real object?
> var_dump($object); //anything changed but not shown in the first call?
> $object->getLazyAnnotatedObjectStorage()->valid();
> var_dump($object); //what about now?
>
>
> Replace "LazyAnnotatedObjectStorage" with the actual property name, assuming 
> it has a same-named get-method. (it should)

Last night i changed the relations in my domain model and added @lazy 
annotations (to parent objects and child object storages). Curiously, 
now some parts of the application do not work as they did before: A not 
persistable property, being set based on certain criteria while looping 
through the (bidirectional) relation levels (A <-1:n-> B <-n:1-> C) 
isn't set any longer (or maybe just the object comparison fails)

The strange thing with it is the following: As soon as i var_dump() 
anything at the right place, everything works as before (like without 
lazy loading).

And i figured out something else which seems strange: When trying 
around with the relations and lazy lading, i've changed a persistable 
property of an object by it's setter. Although i don't ask the 
repository to update anything on any place, this property has been 
saved to the db, obviously just because the var_dump() statement?

Now i am even more astonished.

Kind regards, Jan




More information about the TYPO3-project-typo3v4mvc mailing list