HistoryAction::getType()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Pim\Bundle\CustomEntityBundle\Action;
4
5
use Symfony\Component\OptionsResolver\OptionsResolver;
6
7
/**
8
 * @author    Antoine Guigan <[email protected]>
9
 * @copyright 2014 Akeneo SAS (http://www.akeneo.com)
10
 * @license   http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
11
 */
12
class HistoryAction extends AbstractViewableAction
13
{
14
    /**
15
     * {@inheritdoc}
16
     */
17
    public function getType()
18
    {
19
        return 'history';
20
    }
21
22
    /**
23
     * {@inheritdoc}
24
     */
25
    protected function setDefaultOptions(OptionsResolver $resolver)
26
    {
27
        parent::setDefaultOptions($resolver);
28
29
        $resolver->setDefaults(
30
            [
31
                'template'      => 'PimCustomEntityBundle:CustomEntity:_history.html.twig',
32
                'route'         => 'pim_customentity_history',
33
                'datagrid_name' => 'history-grid'
34
            ]
35
        );
36
    }
37
38
    /**
39
     * {@inheritdoc}
40
     */
41
    protected function getDefaultTemplateVars()
42
    {
43
        return parent::getDefaultTemplateVars() + ['datagridName' => $this->options['datagrid_name']];
44
    }
45
}
46