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

AbstractNavigation   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 71.43%

Importance

Changes 0
Metric Value
dl 0
loc 23
ccs 5
cts 7
cp 0.7143
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getChildComponentGroup() 0 3 1
A __construct() 0 5 1
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