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

AbstractNavigation   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

2 Methods

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