public function getAttachments() { if (count($this->attachments) == 0) { return; } return $this->attachments; }
public function removeAttachmentFormArticle(Article $article, Attachment $attachment) { $article->getAttachments()->removeElement($attachment); $this->em->flush(); }