add batch action

This commit is contained in:
Simon Vieille 2021-06-03 14:04:39 +02:00
parent 9755472833
commit e670714f0e

View file

@ -2,21 +2,20 @@
namespace App\Controller\Blog;
use App\Core\Controller\Admin\AdminController;
use App\Core\Controller\Admin\Crud\CrudController;
use App\Core\Crud\CrudConfiguration;
use App\Core\Crud\Field\DatetimeField;
use App\Core\Crud\Field\TextField;
use App\Core\Entity\EntityInterface;
use App\Core\Manager\EntityManager;
use App\Entity\Blog\Comment as Entity;
use App\Form\Blog\CommentType as EntityType;
use App\Form\Blog\CommentType;
use App\Form\Blog\Filter\CommentFilterType;
use App\Repository\Blog\CommentRepositoryQuery as RepositoryQuery;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\Routing\Annotation\Route;
use App\Core\Controller\Admin\Crud\CrudController;
use App\Core\Crud\CrudConfiguration;
use App\Core\Crud\Field\DatetimeField;
use App\Core\Crud\Field\TextField;
use App\Form\Blog\CommentType;
/**
* @Route("/admin/blog/comment")
@ -62,7 +61,7 @@ class CommentAdminController extends CrudController
'attr' => ['class' => 'miw-100'],
])
->setBatchAction('index', 'delete', 'Delete', function(EntityInterface $entity, EntityManager $manager) {
->setBatchAction('index', 'delete', 'Delete', function (EntityInterface $entity, EntityManager $manager) {
$manager->delete($entity);
})
;