public function addAttachment($fileAttachment) { if (!$this->getAttachments()) { return $this->setAttachments(array($fileAttachment)); } else { return $this->setAttachments(array_merge($this->getAttachments(), array($fileAttachment))); } }