Completed
Push — develop ( 9cf3b3...935520 )
by Daniel
06:16
created

AbstractNavigation::getChildComponentGroup()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Silverback\ApiComponentBundle\Entity\Content\Component\Navigation;
4
5
use ApiPlatform\Core\Annotation\ApiProperty;
6
use Doctrine\ORM\Mapping as ORM;
7
use Silverback\ApiComponentBundle\Entity\Content\Component\AbstractComponent;
8
use Silverback\ApiComponentBundle\Entity\Content\ComponentGroup;
9
use Symfony\Component\Serializer\Annotation\Groups;
10
11
/**
12
 * Class AbstractNavigation
13
 * @package Silverback\ApiComponentBundle\Entity\Navigation
14
 * @author Daniel West <[email protected]>
15
 */
16
abstract class AbstractNavigation extends AbstractComponent
17
{
18
    /**
19
     * @ORM\ManyToOne(targetEntity="Silverback\ApiComponentBundle\Entity\Content\ComponentGroup", cascade={"persist"})
20
     * @ApiProperty(attributes={"fetchEager": false})
21
     * @Groups({"layout", "route", "content"})
22
     * @var ComponentGroup
23
     */
24
    protected $childComponentGroup;
25
26 6
    public function __construct()
27
    {
28 6
        parent::__construct();
29 6
        $this->childComponentGroup = new ComponentGroup();
30 6
        $this->childComponentGroup->setParent($this);
31 6
    }
32
33
    /**
34
     * @return ComponentGroup
35
     */
36
    public function getChildComponentGroup(): ComponentGroup
37
    {
38
        return $this->childComponentGroup;
39
    }
40
}
41