@@ -119,18 +119,27 @@ class Post
119
119
*/
120
120
private $ tags ;
121
121
122
+ /**
123
+ *
124
+ */
122
125
public function __construct ()
123
126
{
124
127
$ this ->publishedAt = new \DateTime ();
125
128
$ this ->comments = new ArrayCollection ();
126
129
$ this ->tags = new ArrayCollection ();
127
130
}
128
131
132
+ /**
133
+ * @return int
134
+ */
129
135
public function getId ()
130
136
{
131
137
return $ this ->id ;
132
138
}
133
139
140
+ /**
141
+ * @return string
142
+ */
134
143
public function getTitle ()
135
144
{
136
145
return $ this ->title ;
@@ -144,6 +153,9 @@ public function setTitle($title)
144
153
$ this ->title = $ title ;
145
154
}
146
155
156
+ /**
157
+ * @return string
158
+ */
147
159
public function getSlug ()
148
160
{
149
161
return $ this ->slug ;
@@ -157,6 +169,9 @@ public function setSlug($slug)
157
169
$ this ->slug = $ slug ;
158
170
}
159
171
172
+ /**
173
+ * @return string
174
+ */
160
175
public function getContent ()
161
176
{
162
177
return $ this ->content ;
@@ -170,11 +185,17 @@ public function setContent($content)
170
185
$ this ->content = $ content ;
171
186
}
172
187
188
+ /**
189
+ * @return \DateTime
190
+ */
173
191
public function getPublishedAt ()
174
192
{
175
193
return $ this ->publishedAt ;
176
194
}
177
195
196
+ /**
197
+ * @param \DateTime $publishedAt
198
+ */
178
199
public function setPublishedAt (\DateTime $ publishedAt )
179
200
{
180
201
$ this ->publishedAt = $ publishedAt ;
@@ -196,22 +217,34 @@ public function setAuthor(User $author)
196
217
$ this ->author = $ author ;
197
218
}
198
219
220
+ /**
221
+ * @return Comment[]|ArrayCollection
222
+ */
199
223
public function getComments ()
200
224
{
201
225
return $ this ->comments ;
202
226
}
203
227
228
+ /**
229
+ * @param Comment $comment
230
+ */
204
231
public function addComment (Comment $ comment )
205
232
{
206
233
$ this ->comments ->add ($ comment );
207
234
$ comment ->setPost ($ this );
208
235
}
209
236
237
+ /**
238
+ * @param Comment $comment
239
+ */
210
240
public function removeComment (Comment $ comment )
211
241
{
212
242
$ this ->comments ->removeElement ($ comment );
213
243
}
214
244
245
+ /**
246
+ * @return string
247
+ */
215
248
public function getSummary ()
216
249
{
217
250
return $ this ->summary ;
@@ -225,18 +258,27 @@ public function setSummary($summary)
225
258
$ this ->summary = $ summary ;
226
259
}
227
260
261
+ /**
262
+ * @param Tag $tag
263
+ */
228
264
public function addTag (Tag $ tag )
229
265
{
230
266
if (!$ this ->tags ->contains ($ tag )) {
231
267
$ this ->tags ->add ($ tag );
232
268
}
233
269
}
234
270
271
+ /**
272
+ * @param Tag $tag
273
+ */
235
274
public function removeTag (Tag $ tag )
236
275
{
237
276
$ this ->tags ->removeElement ($ tag );
238
277
}
239
278
279
+ /**
280
+ * @return Tag[]|ArrayCollection
281
+ */
240
282
public function getTags ()
241
283
{
242
284
return $ this ->tags ;
0 commit comments