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

Anja Leichsenring aleichsenring at ab-softlab.de
Wed Jul 24 14:15:50 CEST 2013


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


More information about the TYPO3-project-typo3v4mvc mailing list