[TYPO3-mvc] Removing Value objects won't work as expected...

Henjo Hoeksma me at henjohoeksma.nl
Wed Apr 13 18:21:18 CEST 2011


On 2011-04-13 18:13:48 +0200, Franz Koch said:

> Hey Henjo,
> 
>> When updating a form (i.e. by an xml parser) I want to clear the current
>> attached value objects completely.
>> 
>> I try so doing:
>> 
>> <code>
>> $newRentOrder =
>> $this->rentOrderRepository->findByUid($arguments['rentOrderUid']);
>> // t3lib_div::debug(count($newRentOrder->getOrderedoptions()));
>> foreach($newRentOrder->getOrderedoptions() as $orderedOption){
>> // t3lib_div::debug($orderedOption);die();
>> $newRentOrder->removeOrderedoption($orderedoption); }
>> </code>
>> 
>> Everytime only half the value object get removed...
> 
> wouldn't it be easier to replace the objectStorage with a empty one, or 
> simply implement a method $newRentOrder->removeAllOrderedOptions() 
> which internally does about the same?
Yeah... thought about it. Might actually be better indeed.
Some times I start trying stuff and see what happens and forget to step 
out of my trying circle :D
> 
>> Any clue on why this is happening?
> 
> unfortunately not.
Too bad... ;-)

Thanks again Franz. Email me your address, I'll sent you a bottle of 
wine - if you like wine :-)
Your support helped me out so many times!

:-)

Henjo




More information about the TYPO3-project-typo3v4mvc mailing list