Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
42 / 42 |
|
100.00% |
28 / 28 |
CRAP | |
100.00% |
1 / 1 |
| NewsMessage | |
100.00% |
42 / 42 |
|
100.00% |
28 / 28 |
28 | |
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 | |||
| getHeader | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setHeader | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getMessage | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setMessage | |
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 | |||
| getAuthor | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setAuthor | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getEmail | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setEmail | |
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 | |||
| isComment | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setComment | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getDateStart | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setDateStart | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getDateEnd | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setDateEnd | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getLink | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setLink | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getLinkTitle | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setLinkTitle | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getLinkTarget | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setLinkTarget | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * The News message model 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 2024-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 2024-03-24 |
| 16 | */ |
| 17 | |
| 18 | declare(strict_types=1); |
| 19 | |
| 20 | namespace phpMyFAQ\Entity; |
| 21 | |
| 22 | use DateTime; |
| 23 | |
| 24 | class NewsMessage |
| 25 | { |
| 26 | private int $id; |
| 27 | |
| 28 | private string $language; |
| 29 | |
| 30 | private string $header; |
| 31 | |
| 32 | private string $message; |
| 33 | |
| 34 | private DateTime $created; |
| 35 | |
| 36 | private string $author; |
| 37 | |
| 38 | private string $email; |
| 39 | |
| 40 | private bool $active; |
| 41 | |
| 42 | private bool $comment; |
| 43 | |
| 44 | private ?DateTime $dateStart = null; |
| 45 | |
| 46 | private ?DateTime $dateEnd = null; |
| 47 | |
| 48 | private ?string $link = null; |
| 49 | |
| 50 | private ?string $linkTitle = null; |
| 51 | |
| 52 | private ?string $linkTarget = null; |
| 53 | |
| 54 | public function getId(): int |
| 55 | { |
| 56 | return $this->id; |
| 57 | } |
| 58 | |
| 59 | public function setId(int $id): NewsMessage |
| 60 | { |
| 61 | $this->id = $id; |
| 62 | return $this; |
| 63 | } |
| 64 | |
| 65 | public function getLanguage(): string |
| 66 | { |
| 67 | return $this->language; |
| 68 | } |
| 69 | |
| 70 | public function setLanguage(string $language): NewsMessage |
| 71 | { |
| 72 | $this->language = $language; |
| 73 | return $this; |
| 74 | } |
| 75 | |
| 76 | public function getHeader(): string |
| 77 | { |
| 78 | return $this->header; |
| 79 | } |
| 80 | |
| 81 | public function setHeader(string $header): NewsMessage |
| 82 | { |
| 83 | $this->header = $header; |
| 84 | return $this; |
| 85 | } |
| 86 | |
| 87 | public function getMessage(): string |
| 88 | { |
| 89 | return $this->message; |
| 90 | } |
| 91 | |
| 92 | public function setMessage(string $message): NewsMessage |
| 93 | { |
| 94 | $this->message = $message; |
| 95 | return $this; |
| 96 | } |
| 97 | |
| 98 | public function getCreated(): DateTime |
| 99 | { |
| 100 | return $this->created; |
| 101 | } |
| 102 | |
| 103 | public function setCreated(DateTime $created): NewsMessage |
| 104 | { |
| 105 | $this->created = $created; |
| 106 | return $this; |
| 107 | } |
| 108 | |
| 109 | public function getAuthor(): string |
| 110 | { |
| 111 | return $this->author; |
| 112 | } |
| 113 | |
| 114 | public function setAuthor(string $author): NewsMessage |
| 115 | { |
| 116 | $this->author = $author; |
| 117 | return $this; |
| 118 | } |
| 119 | |
| 120 | public function getEmail(): string |
| 121 | { |
| 122 | return $this->email; |
| 123 | } |
| 124 | |
| 125 | public function setEmail(string $email): NewsMessage |
| 126 | { |
| 127 | $this->email = $email; |
| 128 | return $this; |
| 129 | } |
| 130 | |
| 131 | public function isActive(): bool |
| 132 | { |
| 133 | return $this->active; |
| 134 | } |
| 135 | |
| 136 | public function setActive(bool $active): NewsMessage |
| 137 | { |
| 138 | $this->active = $active; |
| 139 | return $this; |
| 140 | } |
| 141 | |
| 142 | public function isComment(): bool |
| 143 | { |
| 144 | return $this->comment; |
| 145 | } |
| 146 | |
| 147 | public function setComment(bool $comment): NewsMessage |
| 148 | { |
| 149 | $this->comment = $comment; |
| 150 | return $this; |
| 151 | } |
| 152 | |
| 153 | public function getDateStart(): ?DateTime |
| 154 | { |
| 155 | return $this->dateStart ?? null; |
| 156 | } |
| 157 | |
| 158 | public function setDateStart(DateTime $dateStart): NewsMessage |
| 159 | { |
| 160 | $this->dateStart = $dateStart; |
| 161 | return $this; |
| 162 | } |
| 163 | |
| 164 | public function getDateEnd(): ?DateTime |
| 165 | { |
| 166 | return $this->dateEnd ?? null; |
| 167 | } |
| 168 | |
| 169 | public function setDateEnd(DateTime $dateEnd): NewsMessage |
| 170 | { |
| 171 | $this->dateEnd = $dateEnd; |
| 172 | return $this; |
| 173 | } |
| 174 | |
| 175 | public function getLink(): string |
| 176 | { |
| 177 | return $this->link ?? ''; |
| 178 | } |
| 179 | |
| 180 | public function setLink(string $link): NewsMessage |
| 181 | { |
| 182 | $this->link = $link; |
| 183 | return $this; |
| 184 | } |
| 185 | |
| 186 | public function getLinkTitle(): string |
| 187 | { |
| 188 | return $this->linkTitle ?? ''; |
| 189 | } |
| 190 | |
| 191 | public function setLinkTitle(string $linkTitle): NewsMessage |
| 192 | { |
| 193 | $this->linkTitle = $linkTitle; |
| 194 | return $this; |
| 195 | } |
| 196 | |
| 197 | public function getLinkTarget(): string |
| 198 | { |
| 199 | return $this->linkTarget ?? ''; |
| 200 | } |
| 201 | |
| 202 | public function setLinkTarget(string $linkTarget): NewsMessage |
| 203 | { |
| 204 | $this->linkTarget = $linkTarget; |
| 205 | return $this; |
| 206 | } |
| 207 | } |