DeleteAction::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 17
rs 9.7
c 0
b 0
f 0
cc 1
nc 1
nop 2
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