Passed
Push — develop ( e0f0df...fa4b42 )
by Daniel
05:31
created

Page::getTitle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Silverback\ApiComponentBundle\Entity\Content;
4
5
use ApiPlatform\Core\Annotation\ApiProperty;
6
use ApiPlatform\Core\Annotation\ApiResource;
7
use Doctrine\ORM\Mapping as ORM;
8
use Silverback\ApiComponentBundle\Entity\Layout\Layout;
9
use Symfony\Component\Serializer\Annotation\Groups;
10
11
/**
12
 * Class Page
13
 * @package Silverback\ApiComponentBundle\Entity\Content
14
 * @author Daniel West <[email protected]>
15
 * @ApiResource()
16
 * @ORM\Entity()
17
 */
18
class Page extends AbstractContent
19
{
20
    /**
21
     * @ORM\Column()
22
     * @Groups({"content"})
23
     * @var string
24
     */
25
    private $title;
26
27
    /**
28
     * @ORM\Column()
29
     * @Groups({"content"})
30
     * @var string
31
     */
32
    private $metaDescription;
33
34
    /**
35
     * @ORM\ManyToOne(targetEntity="Page")
36
     * @ORM\JoinColumn(nullable=true)
37
     * @var null|Page
38
     */
39
    private $parent;
40
41
    /**
42
     * @ORM\ManyToOne(targetEntity="Silverback\ApiComponentBundle\Entity\Layout\Layout")
43
     * @ORM\JoinColumn(onDelete="SET NULL")
44
     * @ApiProperty()
45
     * @Groups({"content"})
46
     * @var Layout|null
47
     */
48
    private $layout;
49
50
    /**
51
     * @return string
52
     */
53 1
    public function getTitle(): string
54
    {
55 1
        return $this->title;
56
    }
57
58
    /**
59
     * @param string $title
60
     */
61 1
    public function setTitle(string $title): void
62
    {
63 1
        $this->title = $title;
64 1
    }
65
66
    /**
67
     * @return string
68
     */
69 1
    public function getMetaDescription(): string
70
    {
71 1
        return $this->metaDescription;
72
    }
73
74
    /**
75
     * @param string $metaDescription
76
     */
77 1
    public function setMetaDescription(string $metaDescription): void
78
    {
79 1
        $this->metaDescription = $metaDescription;
80 1
    }
81
82
    /**
83
     * @return null|Page
84
     */
85 1
    public function getParent(): ?Page
86
    {
87 1
        return $this->parent;
88
    }
89
90
    /**
91
     * @param null|Page $parent
92
     */
93 1
    public function setParent(?Page $parent): void
94
    {
95 1
        $this->parent = $parent;
96 1
    }
97
98
    /**
99
     * @return Layout|null
100
     */
101 1
    public function getLayout(): ?Layout
102
    {
103 1
        return $this->layout;
104
    }
105
106
    /**
107
     * @param Layout|null $layout
108
     */
109 1
    public function setLayout(?Layout $layout): void
110
    {
111 1
        $this->layout = $layout;
112 1
    }
113
}
114