Completed
Pull Request — master (#94)
by Piotr
08:16
created

PageSettings   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 37
c 1
b 0
f 0
wmc 7
lcom 0
cbo 2
rs 10
1
<?php
2
3
/**
4
 * (c) FSi sp. z o.o. <[email protected]>
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace FSi\FixturesBundle\Admin;
11
12
use FSi\Bundle\AdminBundle\Doctrine\Admin\CRUDElement;
13
use FSi\Bundle\AdminSecurityBundle\Admin\SecuredElementInterface;
14
use FSi\Component\DataGrid\DataGridFactoryInterface;
15
use FSi\Component\DataSource\DataSourceFactoryInterface;
16
use Symfony\Component\Form\FormFactoryInterface;
17
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
18
19
class PageSettings extends CRUDElement implements SecuredElementInterface
20
{
21
    public function isAllowed(AuthorizationCheckerInterface $authorizationChecker)
22
    {
23
        return $authorizationChecker->isGranted('ROLE_ADMIN');
24
    }
25
26
    public function getClassName()
27
    {
28
        return 'FSiFixturesBundle:PageSettings';
29
    }
30
31
    public function getId()
32
    {
33
        return 'page_settings';
34
    }
35
36
    public function getName()
37
    {
38
        return 'Page settings';
39
    }
40
41
    protected function initDataGrid(DataGridFactoryInterface $factory)
42
    {
43
        return null;
44
    }
45
46
    protected function initDataSource(DataSourceFactoryInterface $factory)
47
    {
48
        return null;
49
    }
50
51
    protected function initForm(FormFactoryInterface $factory, $data = null)
52
    {
53
        return null;
54
    }
55
}
56