sonata-project/SonataAdminBundle — pull request #1318 by henter (2013-05-02 09:25:02+00:00)
Title: add removing hook "preRemove" & "preBatchRemove" for ListAction

I just got the same problem with [#issue 1314](https://github.com/sonata-project/SonataAdminBundle/issues/1314), and I added the removing hook.

You can put a function "preBatchRemove" in your Admin class, and it will be involved with a preameter `$idx` while you are deleting something in ListAction.
```php
public function preBatchRemove($idx){
foreach($idx as $id){
// do sth ...
}
}
```

if no function "preBatchRemove" created, the "preRemove" will be involved as usual, maybe it's lack of performance, but anyway, it just works fine.
```php
public function preRemove($object){
// ...
}
```