id = $id; $this->name = $name; $this->type = $type; $this->content = $content; $this->size = $size; } public static function fromMimePart(Horde_Mime_Part $mimePart): self { return new Attachment( $mimePart->getMimeId(), $mimePart->getName(), $mimePart->getType(), $mimePart->getContents(), (int)$mimePart->getBytes(), ); } public function getId(): ?string { return $this->id; } public function getName(): ?string { return $this->name; } public function getType(): string { return $this->type; } public function getContent(): string { return $this->content; } public function getSize(): int { return $this->size; } }