Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
39 / 39 |
|
100.00% |
26 / 26 |
CRAP | |
100.00% |
1 / 1 |
| CustomPageEntity | |
100.00% |
39 / 39 |
|
100.00% |
26 / 26 |
26 | |
100.00% |
1 / 1 |
| getId | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setId | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getLanguage | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setLanguage | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getPageTitle | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setPageTitle | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getSlug | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setSlug | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getContent | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setContent | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getAuthorName | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setAuthorName | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getAuthorEmail | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setAuthorEmail | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| isActive | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setActive | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getCreated | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setCreated | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getUpdated | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setUpdated | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getSeoTitle | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setSeoTitle | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getSeoDescription | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setSeoDescription | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getSeoRobots | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setSeoRobots | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * The Custom Page entity class |
| 5 | * |
| 6 | * This Source Code Form is subject to the terms of the Mozilla Public License, |
| 7 | * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
| 8 | * obtain one at https://mozilla.org/MPL/2.0/. |
| 9 | * |
| 10 | * @package phpMyFAQ\Entity |
| 11 | * @author Thorsten Rinne <thorsten@phpmyfaq.de> |
| 12 | * @copyright 2026 phpMyFAQ Team |
| 13 | * @license https://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
| 14 | * @link https://www.phpmyfaq.de |
| 15 | * @since 2026-01-12 |
| 16 | */ |
| 17 | |
| 18 | declare(strict_types=1); |
| 19 | |
| 20 | namespace phpMyFAQ\Entity; |
| 21 | |
| 22 | use DateTime; |
| 23 | |
| 24 | class CustomPageEntity |
| 25 | { |
| 26 | private int $id; |
| 27 | |
| 28 | private string $language; |
| 29 | |
| 30 | private string $pageTitle; |
| 31 | |
| 32 | private string $slug; |
| 33 | |
| 34 | private string $content; |
| 35 | |
| 36 | private string $authorName; |
| 37 | |
| 38 | private string $authorEmail; |
| 39 | |
| 40 | private bool $active; |
| 41 | |
| 42 | private DateTime $created; |
| 43 | |
| 44 | private ?DateTime $updated = null; |
| 45 | |
| 46 | private ?string $seoTitle = null; |
| 47 | |
| 48 | private ?string $seoDescription = null; |
| 49 | |
| 50 | private string $seoRobots = 'index,follow'; |
| 51 | |
| 52 | public function getId(): int |
| 53 | { |
| 54 | return $this->id; |
| 55 | } |
| 56 | |
| 57 | public function setId(int $id): CustomPageEntity |
| 58 | { |
| 59 | $this->id = $id; |
| 60 | return $this; |
| 61 | } |
| 62 | |
| 63 | public function getLanguage(): string |
| 64 | { |
| 65 | return $this->language; |
| 66 | } |
| 67 | |
| 68 | public function setLanguage(string $language): CustomPageEntity |
| 69 | { |
| 70 | $this->language = $language; |
| 71 | return $this; |
| 72 | } |
| 73 | |
| 74 | public function getPageTitle(): string |
| 75 | { |
| 76 | return $this->pageTitle; |
| 77 | } |
| 78 | |
| 79 | public function setPageTitle(string $pageTitle): CustomPageEntity |
| 80 | { |
| 81 | $this->pageTitle = $pageTitle; |
| 82 | return $this; |
| 83 | } |
| 84 | |
| 85 | public function getSlug(): string |
| 86 | { |
| 87 | return $this->slug; |
| 88 | } |
| 89 | |
| 90 | public function setSlug(string $slug): CustomPageEntity |
| 91 | { |
| 92 | $this->slug = $slug; |
| 93 | return $this; |
| 94 | } |
| 95 | |
| 96 | public function getContent(): string |
| 97 | { |
| 98 | return $this->content; |
| 99 | } |
| 100 | |
| 101 | public function setContent(string $content): CustomPageEntity |
| 102 | { |
| 103 | $this->content = $content; |
| 104 | return $this; |
| 105 | } |
| 106 | |
| 107 | public function getAuthorName(): string |
| 108 | { |
| 109 | return $this->authorName; |
| 110 | } |
| 111 | |
| 112 | public function setAuthorName(string $authorName): CustomPageEntity |
| 113 | { |
| 114 | $this->authorName = $authorName; |
| 115 | return $this; |
| 116 | } |
| 117 | |
| 118 | public function getAuthorEmail(): string |
| 119 | { |
| 120 | return $this->authorEmail; |
| 121 | } |
| 122 | |
| 123 | public function setAuthorEmail(string $authorEmail): CustomPageEntity |
| 124 | { |
| 125 | $this->authorEmail = $authorEmail; |
| 126 | return $this; |
| 127 | } |
| 128 | |
| 129 | public function isActive(): bool |
| 130 | { |
| 131 | return $this->active; |
| 132 | } |
| 133 | |
| 134 | public function setActive(bool $active): CustomPageEntity |
| 135 | { |
| 136 | $this->active = $active; |
| 137 | return $this; |
| 138 | } |
| 139 | |
| 140 | public function getCreated(): DateTime |
| 141 | { |
| 142 | return $this->created; |
| 143 | } |
| 144 | |
| 145 | public function setCreated(DateTime $created): CustomPageEntity |
| 146 | { |
| 147 | $this->created = $created; |
| 148 | return $this; |
| 149 | } |
| 150 | |
| 151 | public function getUpdated(): ?DateTime |
| 152 | { |
| 153 | return $this->updated ?? null; |
| 154 | } |
| 155 | |
| 156 | public function setUpdated(DateTime $updated): CustomPageEntity |
| 157 | { |
| 158 | $this->updated = $updated; |
| 159 | return $this; |
| 160 | } |
| 161 | |
| 162 | public function getSeoTitle(): ?string |
| 163 | { |
| 164 | return $this->seoTitle; |
| 165 | } |
| 166 | |
| 167 | public function setSeoTitle(?string $seoTitle): CustomPageEntity |
| 168 | { |
| 169 | $this->seoTitle = $seoTitle; |
| 170 | return $this; |
| 171 | } |
| 172 | |
| 173 | public function getSeoDescription(): ?string |
| 174 | { |
| 175 | return $this->seoDescription; |
| 176 | } |
| 177 | |
| 178 | public function setSeoDescription(?string $seoDescription): CustomPageEntity |
| 179 | { |
| 180 | $this->seoDescription = $seoDescription; |
| 181 | return $this; |
| 182 | } |
| 183 | |
| 184 | public function getSeoRobots(): string |
| 185 | { |
| 186 | return $this->seoRobots; |
| 187 | } |
| 188 | |
| 189 | public function setSeoRobots(string $seoRobots): CustomPageEntity |
| 190 | { |
| 191 | $this->seoRobots = $seoRobots; |
| 192 | return $this; |
| 193 | } |
| 194 | } |