[TYPO3-mvc] Extbase PropertyMapper in 1.2.0 (TYPO3 4.4)
Thomas "Thasmo" Deinhamer
thasmo at gmail.com
Wed Feb 16 17:48:35 CET 2011
Thomas "Thasmo" Deinhamer wrote:
> Hello guys!
>
> Previously I was able to do this:
>
> $propertyMapper->map(array('cartItems'), array('cartItems' =>
> $cartItems), $this->customer);
>
> Not sure, but I think since TYPO3 4.4 (Extbase 1.2) this
> doesn't work anymore as the cartItems are empty then.
>
> $cartItems is an array:
> Array(
> [5] => Array(
> [quantity] => 15
> [__identity] => 5
> )
> )
>
> It's about updating a cart item's quantity.
>
> Has there anything changed in the property mapper
> which would cause to clear all cart items instead
> of updating the quantity?
>
> I'm a bit lost here.
>
> Thanks for help,
> Thomas
Hello folks!
After some hours of trial and error I still haven't found the issue.
It's weird. The quantity of the cart items get updated but the cart
item will be set to deleted (= 1).
Actually that's all what I'm doing:
$propertyMapper->map(
array('cartItems'),
array('cartItems' => $cartItems),
$this->customer
);
Where $cartItems is:
Array(
[5] => Array(
[quantity] => 15
[__identity] => 5
)
)
The reason why I do the thing manually is, that Fluid/Extbase can't
persist multiple objects which are send via a form. The cart items
themselves is a object storage property of the model customer.
It would be really great if someone got an idea about that.
How do you update multiple objects via a form?
Thanks a lot,
Thomas
More information about the TYPO3-project-typo3v4mvc
mailing list