src/AdminBundle/Admin/PostLogAdmin.php line 10

Open in your IDE?
  1. <?php
  2. namespace AdminBundle\Admin;
  3. use Sonata\AdminBundle\Admin\AbstractAdmin;
  4. use Sonata\AdminBundle\Datagrid\DatagridMapper;
  5. use Sonata\AdminBundle\Datagrid\ListMapper;
  6. use Sonata\AdminBundle\Show\ShowMapper;
  7. class PostLogAdmin extends AbstractAdmin
  8. {
  9.     protected function configureDatagridFilters(DatagridMapper $datagridMapper): void
  10.     {
  11.         $datagridMapper
  12.             ->add('update_date')
  13.         ;
  14.     }
  15.     protected function configureListFields(ListMapper $listMapper): void
  16.     {
  17.         $listMapper
  18.             ->add('update_date')
  19.             ->add('post.title')
  20.             ->add('_action'null, [
  21.                 'actions' => [
  22.                     'show' => [],
  23.                 ],
  24.             ])
  25.         ;
  26.     }
  27.     protected function configureShowFields(ShowMapper $showMapper): void
  28.     {
  29.         $showMapper
  30.             ->add('update_date')
  31.             ->add('old_value')
  32.             ->add('new_value')
  33.         ;
  34.     }
  35. }