protected function createAttachmentViaPath($file)
    {
        /** @var $byteStream \Swift_ByteStream_FileByteStream */
        $byteStream = $this->getManager()->getDI()->get('\Swift_ByteStream_FileByteStream', [$file]);

        /** @var $image \Swift_Attachment */
        $attachment = $this->getManager()->getDI()->get('\Swift_Attachment')
            ->setFile($byteStream);

        return $attachment;
    }
protected function createAttachmentViaPath($file)
    {
        /** @var $byteStream \Swift_ByteStream_FileByteStream */
        $byteStream = $this->getManager()->getDI()->get('\Swift_ByteStream_FileByteStream', [$file]);

        /** @var $image \Swift_Attachment */
        $attachment = $this->getManager()->getDI()->get('\Swift_Attachment')
            ->setFile($byteStream);

        return $attachment;
    }
protected function createAttachmentViaPath ( $ file ) { /** @var $byteStream \Swift_ByteStream_FileByteStream */ $ byteStream = $ this -> getManager ( ) -> getDI ( ) -> get ( '\Swift_ByteStream_FileByteStream' , [ $ file ] ) ; /** @var $image \Swift_Attachment */ $ attachment = $ this -> getManager ( ) -> getDI ( ) -> get ( '\Swift_Attachment' ) -> setFile ( $ byteStream ) ; return $ attachment ; }
Create a Swift new Attachment from a filesystem path.

@param   string $file

@return \Swift_Attachment

@see \Swift_Attachment::fromPath()
Create a Swift new Attachment from a filesystem path .