Exemplo n.º 1
0
 /**
  * @param Attachment $attachment
  * @return void
  */
 public function addAttachment(Attachment $attachment)
 {
     /** @var \League\Flysystem\Adapter\AbstractAdapter $adapter */
     $adapter = $this->storage->getAdapter();
     $attachmentPath = 'attachments' . DIRECTORY_SEPARATOR . $attachment->getName();
     $this->storage->put($attachmentPath, $attachment->getContent());
     $this->attachments[$attachmentPath] = $adapter->getPathPrefix() . $attachmentPath;
 }
Exemplo n.º 2
0
 /**
  * @param Attachment $attachment
  * @return void
  */
 public function addAttachment(Attachment $attachment)
 {
     $this->attachments[] = ['type' => $attachment->getType(), 'name' => $attachment->getName(), 'content' => base64_encode($attachment->getContent())];
 }