Completed
Push — master ( 57b021...d38ccd )
by Nicolas
29:22 queued 27:52
created

TagAdmin   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 4
dl 0
loc 41
ccs 0
cts 26
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A configureListFields() 0 6 1
A configureFormFields() 0 11 1
A configureShowFields() 0 10 1
1
<?php
2
3
namespace Smart\ContentBundle\Admin;
4
5
use Smart\SonataBundle\Admin\AbstractAdmin;
6
use Sonata\AdminBundle\Datagrid\ListMapper;
7
use Sonata\AdminBundle\Form\FormMapper;
8
use Sonata\AdminBundle\Show\ShowMapper;
9
10
/**
11
 * Nicolas Bastien <[email protected]>
12
 */
13
class TagAdmin extends AbstractAdmin
14
{
15
    /**
16
     * {@inheritdoc}
17
     */
18
    public function configureListFields(ListMapper $list)
19
    {
20
        $list
21
            ->addIdentifier('id')
22
        ;
23
    }
24
25
    /**
26
     * {@inheritdoc}
27
     */
28
    public function configureFormFields(FormMapper $form)
29
    {
30
        $form
31
32
            ->tab('tab.label_content')
33
                ->with('fieldset.label_general', ['class' => 'col-md-8'])
34
                    ->add('name')
35
                ->end()
36
            ->end()
37
        ;
38
    }
39
40
    /**
41
     * {@inheritDoc}
42
     */
43
    protected function configureShowFields(ShowMapper $show)
44
    {
45
        $show
46
            ->tab('tab.label_content')
47
                ->with('fieldset.label_general', ['class' => 'col-md-8'])
48
                    ->add('name', null, ['label' => 'form.label_name'])
49
                ->end()
50
            ->end()
51
        ;
52
    }
53
}
54