[TYPO3-mvc] extbase: pass array of models to an action for mass update?

Patrick Schriner patrick.schriner at diemedialen.de
Wed Jul 24 15:16:57 CEST 2013


Thanks for the clarification!

On Wed, 24 Jul 2013 14:15:50 +0200, Anja Leichsenring  
<aleichsenring at ab-softlab.de> wrote:

> On 07/24/2013 01:12 PM, Patrick Schriner wrote:
>> On Wed, 24 Jul 2013 12:49:50 +0200, Philipp <philippwrann at gmx.at> wrote:
>>
>>> I think you would have to handle this with an array as ActionArgument
>>> holding the uids of your records and their labels, then load all
>>> records from the repo, create a findByUidList method for that case,
>>> where you perform a select-in-query, iterate over them, set the title,
>>> update the record and persist the changes. As far as i know you dont
>>> have to call the persistenceManager to persist the alterations when
>>> called the update method - as the repo automatically persists all
>>> updated models.
>>
>> This is no longer correct for >= 6.1 - you have to call persistAll
>> explicitly (though only once, in the end).
>>
>
> That is not correct. Still persistAll() is performed automatically when  
> you leave an action. What you have to call on your own and explicitely  
> for every changed object is update()!!!!
> That adds the object to the list of records that need their changes  
> persited.
> If you leave that out, your changes are not persisted.
>
> Best Anja


-- 
Patrick Schriner


More information about the TYPO3-project-typo3v4mvc mailing list