[TYPO3-mvc] Removing Value objects won't work as expected...
Franz Koch
typo3.RemoveForMessage at elements-net.de
Wed Apr 13 18:13:48 CEST 2011
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?
> Any clue on why this is happening?
unfortunately not.
--
kind regards,
Franz Koch
More information about the TYPO3-project-typo3v4mvc
mailing list