Completed
Push — master ( 5bc326...973a57 )
by Benjamin
05:33 queued 02:50
created

AdminTranslation   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 23
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configureRoutes() 0 5 1
A getAvailableCommands() 0 11 1
1
<?php
2
3
namespace Alpixel\Bundle\CMSBundle\Admin;
4
5
use Sonata\AdminBundle\Admin\AbstractAdmin;
6
use Sonata\AdminBundle\Route\RouteCollection;
7
8
/**
9
 * @author Alexis BUSSIERES <[email protected]>
10
 */
11
class AdminTranslation extends AbstractAdmin
12
{
13
    protected $baseRouteName = 'alpixel_admin_cms_command_translation';
14
    protected $baseRoutePattern = 'command/translation';
15
16
    public function configureRoutes(RouteCollection $collection)
17
    {
18
        $collection->clearExcept(['list']);
19
        $collection->add('command');
20
    }
21
22
    public static function getAvailableCommands()
23
    {
24
        return [[
25
            'name'      => 'alpixel:cms:translations:download',
26
            'arguments' => [
27
                'flush_cache' => true,
28
            ],
29
            'label'     => 'Importer les traductions',
30
            'icon'      => 'download'
31
        ]];
32
    }
33
}
34