Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
18 / 18 |
|
100.00% |
12 / 12 |
CRAP | |
100.00% |
1 / 1 |
| Vote | |
100.00% |
18 / 18 |
|
100.00% |
12 / 12 |
12 | |
100.00% |
1 / 1 |
| getId | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setId | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getFaqId | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setFaqId | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getVote | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setVote | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getUsers | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setUsers | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getCreatedAt | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setCreatedAt | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getIp | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setIp | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Vote 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 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-29 |
| 16 | */ |
| 17 | |
| 18 | declare(strict_types=1); |
| 19 | |
| 20 | namespace phpMyFAQ\Entity; |
| 21 | |
| 22 | use DateTime; |
| 23 | |
| 24 | class Vote |
| 25 | { |
| 26 | private int $id; |
| 27 | |
| 28 | private int $faqId; |
| 29 | |
| 30 | private int $vote; |
| 31 | |
| 32 | private int $users; |
| 33 | |
| 34 | private DateTime $createdAt; |
| 35 | |
| 36 | private string $ip; |
| 37 | |
| 38 | public function getId(): int |
| 39 | { |
| 40 | return $this->id; |
| 41 | } |
| 42 | |
| 43 | public function setId(int $id): Vote |
| 44 | { |
| 45 | $this->id = $id; |
| 46 | return $this; |
| 47 | } |
| 48 | |
| 49 | public function getFaqId(): int |
| 50 | { |
| 51 | return $this->faqId; |
| 52 | } |
| 53 | |
| 54 | public function setFaqId(int $faqId): Vote |
| 55 | { |
| 56 | $this->faqId = $faqId; |
| 57 | return $this; |
| 58 | } |
| 59 | |
| 60 | public function getVote(): int |
| 61 | { |
| 62 | return $this->vote; |
| 63 | } |
| 64 | |
| 65 | public function setVote(int $vote): Vote |
| 66 | { |
| 67 | $this->vote = $vote; |
| 68 | return $this; |
| 69 | } |
| 70 | |
| 71 | public function getUsers(): int |
| 72 | { |
| 73 | return $this->users; |
| 74 | } |
| 75 | |
| 76 | public function setUsers(int $users): Vote |
| 77 | { |
| 78 | $this->users = $users; |
| 79 | return $this; |
| 80 | } |
| 81 | |
| 82 | public function getCreatedAt(): DateTime |
| 83 | { |
| 84 | return $this->createdAt; |
| 85 | } |
| 86 | |
| 87 | public function setCreatedAt(DateTime $createdAt): Vote |
| 88 | { |
| 89 | $this->createdAt = $createdAt; |
| 90 | return $this; |
| 91 | } |
| 92 | |
| 93 | public function getIp(): string |
| 94 | { |
| 95 | return $this->ip; |
| 96 | } |
| 97 | |
| 98 | public function setIp(string $ip): Vote |
| 99 | { |
| 100 | $this->ip = $ip; |
| 101 | return $this; |
| 102 | } |
| 103 | } |