/** * @param Attachment $attachment * @returns AttachmentDto */ public static function createFromAttachment(Attachment $attachment) { $dto = new self(); $dto->setFilename($attachment->getFilename()); $dto->setFilePath($attachment->getFile()->getPathname()); return $dto; }