/** * Save all attachments of a given mail * * @param \Shockwavemk\Mail\Base\Model\Mail $mail * @return $this */ public function saveAttachments($mail) { /** @var \Shockwavemk\Mail\Base\Model\Mail\Attachment[] $attachments */ $attachments = $mail->getAttachments(); foreach ($attachments as $attachment) { $this->saveAttachment($attachment); } return $this; }