DeleteAction   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 17 1
1
<?php
2
3
namespace Admingenerator\GeneratorBundle\Generator\Action\Object;
4
5
use Admingenerator\GeneratorBundle\Builder\Admin\BaseBuilder;
6
use Admingenerator\GeneratorBundle\Generator\Action;
7
8
/**
9
 * This class describes object Delete action
10
 *
11
 * @author cedric Lombardot
12
 * @author Piotr Gołębiewski <[email protected]>
13
 */
14
class DeleteAction extends Action
15
{
16
    public function __construct($name, BaseBuilder $builder)
17
    {
18
        parent::__construct($name, 'object');
19
20
        $this->setIcon('fa-times');
21
        $this->setLabel('action.object.delete.label');
22
        $this->setConfirm('action.object.delete.confirm');
23
        $this->setCsrfProtected(true);
24
25
        $this->setRoute($builder->getObjectActionsRoute());
26
27
        $this->setParams(array(
28
            'pk' => '{{ '.$builder->getModelClass().'.'.$builder->getModelPrimaryKeyName().' }}',
29
            'action' => 'delete'
30
        ));
31
32
    }
33
}
34