RepertoireSeasonAdmin::configureListFields()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 15

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 15
ccs 0
cts 8
cp 0
rs 9.7666
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Admin;
6
7
use Sonata\AdminBundle\Admin\AbstractAdmin;
8
use Sonata\AdminBundle\Datagrid\DatagridMapper;
9
use Sonata\AdminBundle\Datagrid\ListMapper;
10
use Sonata\AdminBundle\Form\FormMapper;
11
use Sonata\AdminBundle\Show\ShowMapper;
12
use Sonata\Form\Type\DateTimePickerType;
13
14
final class RepertoireSeasonAdmin extends AbstractAdmin
15
{
16
17
    protected function configureDatagridFilters(DatagridMapper $datagridMapper): void
18
    {
19
        $datagridMapper
20
            ->add('id')
21
            ->add('startDate')
22
            ->add('endDate')
23
            ->add('number')
24
            ;
25
    }
26
27
    protected function configureListFields(ListMapper $listMapper): void
28
    {
29
        $listMapper
30
            ->add('id')
31
            ->add('startDate')
32
            ->add('endDate')
33
            ->add('number')
34
            ->add('_action', null, [
35
                'actions' => [
36
                    'show' => [],
37
                    'edit' => [],
38
                    'delete' => [],
39
                ],
40
            ]);
41
    }
42
43
    protected function configureFormFields(FormMapper $formMapper): void
44
    {
45
        $formMapper
46
            ->add('startDate', DateTimePickerType::class)
47
            ->add('endDate', DateTimePickerType::class)
48
            ->add('number')
49
            ;
50
    }
51
52
    protected function configureShowFields(ShowMapper $showMapper): void
53
    {
54
        $showMapper
55
            ->add('id')
56
            ->add('startDate')
57
            ->add('endDate')
58
            ->add('number')
59
            ;
60
    }
61
}
62