Passed
Push — master ( 77414c...fb8c39 )
by Daniel
12:16
created

AbstractFeature::getTitle()   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 0
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\Feature;
6
7
use Doctrine\ORM\Mapping as ORM;
8
use Silverback\ApiComponentBundle\Entity\Component\AbstractComponent;
9
use Silverback\ApiComponentBundle\Entity\Content\ComponentGroup\ComponentGroup;
10
use Symfony\Component\Serializer\Annotation\Groups;
11
12
abstract class AbstractFeature extends AbstractComponent
13
{
14
    /**
15
     * @ORM\Column()
16 2
     * @Groups({"component", "content"})
17
     * @var null|string
18 2
     */
19 2
    protected $title;
20 2
21 2
    public function __construct()
22
    {
23
        parent::__construct();
24
        $this->addValidComponent(AbstractFeatureItem::class);
25
        $this->addComponentGroup(new ComponentGroup());
26
    }
27
28
    /**
29
     * @return null|string
30
     */
31
    public function getTitle(): ?string
32
    {
33
        return $this->title;
34
    }
35
36
    public function setTitle(?string $title): self
37
    {
38
        $this->title = $title;
39
        return $this;
40
    }
41
42
    public function onDeleteCascade(): bool
43
    {
44
        return true;
45
    }
46
}
47