attachments = new ArrayCollection(); } /******************************************************************************** * * Getters * *********************************************************************************/ /** * Gets all attachments associated with this element. * @return Attachment[]|Collection */ public function getAttachments() : Collection { return $this->attachments; } /** * Adds an attachment to this element * @param Attachment $attachment Attachment * @return $this */ public function addAttachment(Attachment $attachment) : self { //Attachment must be associated with this element $attachment->setElement($this); $this->attachments->add($attachment); return $this; } /** * Removes the given attachment from this element * @param Attachment $attachment * @return $this */ public function removeAttachment(Attachment $attachment) : self { $this->attachments->removeElement($attachment); return $this; } }