add batch action

This commit is contained in:
Simon Vieille 2022-02-19 16:10:47 +01:00
parent 9316fbeb14
commit ad833dd617

View file

@ -85,12 +85,12 @@ class PostAdminController extends CrudController
->setBatchAction('index', 'delete', 'Delete', function(EntityInterface $entity, EntityManager $manager) {
$manager->delete($entity);
})
->setBatchAction('index', 'draft', 'Publier', function(EntityInterface $entity, EntityManager $manager) {
$manager->update($entity->setStatus(Post::DRAFT));
})
->setBatchAction('index', 'publish', 'En brouillon', function(EntityInterface $entity, EntityManager $manager) {
->setBatchAction('index', 'draft', 'Statut : publier', function(EntityInterface $entity, EntityManager $manager) {
$manager->update($entity->setStatus(Post::PUBLISHED));
})
->setBatchAction('index', 'publish', 'Statut : brouillon', function(EntityInterface $entity, EntityManager $manager) {
$manager->update($entity->setStatus(Post::DRAFT));
})
;
}