Passed
Push — develop ( 38826b...ed8f36 )
by Daniel
06:14
created

AbstractNavigation   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 66.67%

Importance

Changes 0
Metric Value
dl 0
loc 22
ccs 4
cts 6
cp 0.6667
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 4 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({"default"})
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
    }
31
32
    /**
33
     * @return ComponentGroup
34
     */
35
    public function getChildComponentGroup(): ComponentGroup
36
    {
37
        return $this->childComponentGroup;
38
    }
39
}
40