Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
6 / 6 |
|
100.00% |
4 / 4 |
CRAP | |
100.00% |
1 / 1 |
| Tag | |
100.00% |
6 / 6 |
|
100.00% |
4 / 4 |
4 | |
100.00% |
1 / 1 |
| getId | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setId | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getName | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setName | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Tags 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 |
| 11 | * @author Thorsten Rinne <thorsten@phpmyfaq.de> |
| 12 | * @copyright 2014-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 2014-08-15 |
| 16 | */ |
| 17 | |
| 18 | declare(strict_types=1); |
| 19 | |
| 20 | namespace phpMyFAQ\Entity; |
| 21 | |
| 22 | /** |
| 23 | * Class TagEntity |
| 24 | * |
| 25 | * @package phpMyFAQ\Entity |
| 26 | */ |
| 27 | class Tag |
| 28 | { |
| 29 | private ?int $id = null; |
| 30 | |
| 31 | private ?string $name = null; |
| 32 | |
| 33 | public function getId(): int |
| 34 | { |
| 35 | return $this->id ?? 0; |
| 36 | } |
| 37 | |
| 38 | public function setId(int $id): Tag |
| 39 | { |
| 40 | $this->id = $id; |
| 41 | return $this; |
| 42 | } |
| 43 | |
| 44 | public function getName(): string |
| 45 | { |
| 46 | return $this->name ?? ''; |
| 47 | } |
| 48 | |
| 49 | public function setName(string $name): Tag |
| 50 | { |
| 51 | $this->name = $name; |
| 52 | return $this; |
| 53 | } |
| 54 | } |