AbstractACPController::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 2
Metric Value
c 2
b 0
f 2
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
/*
3
 * This file is part of the 2martens Web Platform.
4
 *
5
 * (c) Jim Martens <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace TwoMartens\Bundle\CoreBundle\Controller;
12
13
/**
14
 * Base class for all ACP controllers.
15
 *
16
 * @author Jim Martens <[email protected]>
17
 */
18
abstract class AbstractACPController extends AbstractController
19
{
20
    protected $templateVariables;
21
22
    /**
23
     * @var \TwoMartens\Bundle\CoreBundle\Model\Breadcrumb[]
24
     */
25
    protected $breadcrumbs;
26
27
    public function __construct()
28
    {
29
        $this->templateVariables = array();
30
        $this->breadcrumbs = array();
31
    }
32
33
    /**
34
     * Sets the breadcrumbs.
35
     *
36
     * @return void
37
     */
38
    abstract protected function setBreadcrumbs();
39
40
    /**
41
     * Assigns variables to $templateVariables.
42
     */
43
    protected function assignVariables()
44
    {
45
        $this->setBreadcrumbs();
46
47
        $variables = array(
48
            'breadcrumbs' => $this->breadcrumbs
49
        );
50
        $this->templateVariables = array_merge($this->templateVariables, $variables);
51
    }
52
}
53