configureListFields()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 4
ccs 0
cts 4
cp 0
crap 2
rs 10
1
<?php
2
/**
3
 * @author    Gerard van Helden <[email protected]>
4
 * @copyright Zicht Online <http://zicht.nl>
5
 */
6
7
namespace Zicht\Bundle\UrlBundle\Admin;
8
9
use Sonata\AdminBundle\Datagrid\ListMapper;
10
use Sonata\AdminBundle\Show\ShowMapper;
11
use Sonata\AdminBundle\Admin\Admin;
12
use Sonata\AdminBundle\Form\FormMapper;
13
14
/**
15
 * Admin implementation for static reference translations
16
 *
17
 */
18
class StaticReferenceTranslationAdmin extends Admin
0 ignored issues
show
Deprecated Code introduced by
The class Sonata\AdminBundle\Admin\Admin has been deprecated: since version 3.1, to be removed in 4.0. Use Sonata\AdminBundle\AbstractAdmin instead ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

18
class StaticReferenceTranslationAdmin extends /** @scrutinizer ignore-deprecated */ Admin
Loading history...
19
{
20
    protected $parentAssociationMapping = 'static_reference';
21
22
    /**
23
     * @{inheritDoc}
24
     */
25
    public function configureListFields(ListMapper $listMapper)
26
    {
27
        $listMapper
28
            ->addIdentifier('url');
29
    }
30
31
    /**
32
     * @{inheritDoc}
33
     */
34
    protected function configureFormFields(FormMapper $form)
35
    {
36
        $form
37
            ->with('General')
38
            ->add('locale', null, array('required' => true))
39
            ->add('url', null, array('required' => true))
40
            ->end();
41
    }
42
43
    /**
44
     * @{inheritDoc}
45
     */
46
    protected function configureShowFields(ShowMapper $show)
47
    {
48
        $show
49
            ->add('url');
50
    }
51
}
52