We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d90e0c1 commit b5342c1Copy full SHA for b5342c1
src/AppBundle/Entity/Post.php
@@ -203,17 +203,16 @@ public function getComments()
203
204
public function addComment(Comment $comment)
205
{
206
+ $comment->setPost($this);
207
if (!$this->comments->contains($comment)) {
208
$this->comments->add($comment);
- $comment->setPost($this);
209
}
210
211
212
public function removeComment(Comment $comment)
213
214
- if ($this->comments->removeElement($comment)) {
215
- $comment->setPost(null);
216
- }
+ $comment->setPost(null);
+ $this->comments->removeElement($comment);
217
218
219
public function getSummary()
0 commit comments