public function removeAttachment($partAttachment) { $partAttachment->setPart(null); $this->attachments->removeElement($partAttachment); }