Completed
Push — master ( 0be8e1...585ca2 )
by Daniel
59:26 queued 46:02
created

AbstractNavigation::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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