Total Complexity | 10 |
Total Lines | 66 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
10 | trait PageTrait |
||
11 | { |
||
12 | /** |
||
13 | * @ORM\Column() |
||
14 | * @Groups({"default"}) |
||
15 | * @var string |
||
16 | */ |
||
17 | protected $title = 'Unnamed Page'; |
||
18 | |||
19 | /** |
||
20 | * @ORM\Column(nullable=true) |
||
21 | * @Groups({"content", "route"}) |
||
22 | * @var string |
||
23 | */ |
||
24 | protected $metaDescription; |
||
25 | |||
26 | /** |
||
27 | * @ORM\ManyToOne(targetEntity="Silverback\ApiComponentBundle\Entity\Layout\Layout") |
||
28 | * @ORM\JoinColumn(onDelete="SET NULL") |
||
29 | * @ApiProperty() |
||
30 | * @Groups({"content","route"}) |
||
31 | * @var Layout|null |
||
32 | */ |
||
33 | protected $layout; |
||
34 | |||
35 | public function getTitle(): string |
||
36 | { |
||
37 | return $this->title ?: 'unnamed'; |
||
38 | } |
||
39 | |||
40 | public function setTitle(string $title): self |
||
41 | { |
||
42 | $this->title = $title; |
||
43 | return $this; |
||
44 | } |
||
45 | |||
46 | public function getMetaDescription(): string |
||
47 | { |
||
48 | return $this->metaDescription ?: ''; |
||
49 | } |
||
50 | |||
51 | public function setMetaDescription(string $metaDescription): self |
||
52 | { |
||
53 | $this->metaDescription = $metaDescription; |
||
54 | return $this; |
||
55 | } |
||
56 | |||
57 | public function getLayout(): ?Layout |
||
60 | } |
||
61 | |||
62 | public function setLayout(?Layout $layout): self |
||
63 | { |
||
64 | $this->layout = $layout; |
||
65 | return $this; |
||
66 | } |
||
67 | |||
68 | public function getDefaultRoute(): string |
||
71 | } |
||
72 | |||
73 | public function getDefaultRouteName(): string |
||
76 | } |
||
77 | } |
||
78 |