1 | <?php |
||
17 | class Trail extends AbstractEntity |
||
18 | { |
||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | private $name; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | private $description; |
||
28 | |||
29 | /** |
||
30 | * @var array|Post[] |
||
31 | */ |
||
32 | private $posts; |
||
33 | |||
34 | /** |
||
35 | * Trail constructor. |
||
36 | * @param string $name |
||
37 | * @param string $description |
||
38 | * @param string|null $id |
||
39 | * @param Post[] $posts |
||
40 | * @throws InvalidUuidStringException |
||
41 | */ |
||
42 | 9 | public function __construct(string $name, string $description, string $id = null, array $posts = []) |
|
49 | |||
50 | /** |
||
51 | * @codeCoverageIgnore |
||
52 | * @return string |
||
53 | */ |
||
54 | public function getName(): string |
||
58 | |||
59 | /** |
||
60 | * @codeCoverageIgnore |
||
61 | * @param string $name |
||
62 | */ |
||
63 | public function setName(string $name) |
||
67 | |||
68 | /** |
||
69 | * @codeCoverageIgnore |
||
70 | * @return string |
||
71 | */ |
||
72 | public function getDescription(): string |
||
76 | |||
77 | /** |
||
78 | * @codeCoverageIgnore |
||
79 | * @param string $description |
||
80 | */ |
||
81 | public function setDescription(string $description) |
||
85 | |||
86 | /** |
||
87 | * @return Post[] |
||
88 | */ |
||
89 | 6 | public function getPosts(): array |
|
93 | |||
94 | /** |
||
95 | * @param Post[] $posts |
||
96 | */ |
||
97 | 9 | public function setPosts($posts) |
|
101 | |||
102 | /** |
||
103 | * @param Post $post |
||
104 | * @return $this |
||
105 | */ |
||
106 | 3 | public function addPost(Post $post) |
|
114 | |||
115 | /** |
||
116 | * @param Post $post |
||
117 | * @return $this |
||
118 | */ |
||
119 | 3 | public function removePost(Post $post) |
|
132 | } |
||
133 |