setPageTitle('index', 'Commentaire') ->setPageTitle('edit', 'Par {author}') ->setPageTitle('show', 'Par {author}') ->setPageRoute('index', 'admin_blog_comment_index') ->setPageRoute('edit', 'admin_blog_comment_edit') ->setPageRoute('show', 'admin_blog_comment_show') ->setPageRoute('delete', 'admin_blog_comment_delete') ->setPageRoute('filter', 'admin_blog_comment_filter') ->setForm('edit', CommentType::class, []) ->setForm('filter', CommentFilterType::class, []) ->setAction('index', 'new', false) ->setView('show_entity', 'blog/comment_admin/_show.html.twig') ->setView('form', 'blog/comment_admin/_form.html.twig') ->setField('index', 'Auteur', TextField::class, [ 'view' => 'blog/comment_admin/field/author.html.twig', 'attr' => ['class' => 'miw-300'], ]) ->setField('index', 'Date', DatetimeField::class, [ 'property' => 'createdAt', 'attr' => ['class' => 'miw-200'], ]) ->setField('index', 'Status', TextField::class, [ 'view' => 'blog/comment_admin/field/status.html.twig', 'attr' => ['class' => 'miw-100'], ]) ; } /** * @Route("/{page}", name="admin_blog_comment_index", requirements={"page": "\d+"}) */ public function index(int $page = 1, RepositoryQuery $query, Request $request, Session $session): Response { $query->orderBy('.id', 'DESC'); return $this->doIndex($page, $query, $request, $session); } /** * @Route("/edit/{entity}", name="admin_blog_comment_edit") */ public function edit(Entity $entity, EntityManager $entityManager, Request $request): Response { return $this->doEdit($entity, $entityManager, $request); } /** * @Route("/show/{entity}", name="admin_blog_comment_show") */ public function show(Entity $entity): Response { return $this->doShow($entity); } /** * @Route("/filters", name="admin_blog_comment_filter") */ public function filter(Session $session): Response { return $this->doFilter($session); } /** * @Route("/delete/{entity}", name="admin_blog_comment_delete", methods={"DELETE"}) */ public function delete(Entity $entity, EntityManager $entityManager, Request $request): Response { return $this->doDelete($entity, $entityManager, $request); } public function getSection(): string { return 'blog_comment'; } }