Page::getSubnav()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/**
4
 * @author    Markus Tacker <[email protected]>
5
 * @copyright 2013-2016 Verein zur Förderung der Netzkultur im Rhein-Main-Gebiet e.V. | http://netzkultur-rheinmain.de/
6
 */
7
8
namespace BCRM\WebBundle\Content;
9
10
use BCRM\BackendBundle\Content\Info;
11
use Doctrine\Common\Collections\ArrayCollection;
12
13
class Page extends Info
14
{
15
    /**
16
     * @var \Doctrine\Common\Collections\ArrayCollection
17
     */
18
    protected $subnav;
19
20
    public function __construct()
21
    {
22
        $this->subnav     = new ArrayCollection();
23
        $this->properties = new ArrayCollection(
24
            array('subnav' => 1)
25
        );
26
    }
27
28
    /**
29
     * @return \Doctrine\Common\Collections\ArrayCollection
30
     */
31
    public function getSubnav()
32
    {
33
        return $this->subnav;
34
    }
35
36
    /**
37
     * @param \Doctrine\Common\Collections\ArrayCollection $subnav
38
     */
39
    public function setSubnav($subnav)
40
    {
41
        $this->subnav = $subnav;
42
    }
43
44
    /**
45
     * Returns whether this page should not be displayed.
46
     * 
47
     * @return bool
48
     */
49
    public function isHidden()
50
    {
51
        return $this->getProperties()->containsKey('hidden') && $this->getProperties()->get('hidden') == 1;
52
    }
53
}
54