[Flow] Implementing mass deletion in Flow
Pankaj Lele
pankaj at lelesys.com
Wed Sep 4 11:29:52 CEST 2013
Hello François,
> My basic approach would be to query the corresponding repository to get
> all records matching the age criterion, loop over the results and call
> remove() for each of them, then do a persistAll(). However I suspect
> this will issue a SQL DELETE for each record whereas a single query like
>
> DELETE FROM table WHERE age < xxx
You can simply use the DQL DELETE [1]
Instead of developing new command you can use doctrine:dql command. But
if you still want to develop own command then you can have look at
TYPO3\Flow\Command\DoctrineCommandController.
[1]
http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/dql-doctrine-query-language.html#delete-queries
--
Pankaj Lele
CTO - Lelesys, India
http://www.lelesys.com
Twitter: @pankajlele
More information about the Flow
mailing list