/
AleksWork
/
diary_plants
Обзор
Документация
Войти
/
AleksWork
/
diary_plants
Код
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/Domain/ValueObject/Attachment/FileInfo.php
58 строк
1 KB
AlexeySerov
Move some fields from Attachment entity to his VolumeObject
03 мар 2026, 15:52
03 мар 2026, 15:52
8cd0ef3
Код
Авторство
О чём код?
<?php //метаданные файла namespace App\Domain\ValueObject\Attachment; use DateTimeImmutable; use Doctrine\ORM\Mapping as ORM; #[ORM\Embeddable] class FileInfo { //имя файла #[ORM\Column(name: 'filename', type: 'string', length: 255, nullable: true)] private ?string $filename = null; //путь к файлу #[ORM\Column(name: 'path', type: 'string', length: 255, nullable: true)] private ?string $path = null; //тип майм файла #[ORM\Column(name: 'mime_type', type: 'string', length: 50, nullable: true)] private ?string $mimeType = null; //дата загрузки файла #[ORM\Column(name: 'file_date', type: 'datetimetz_immutable', nullable: true)] private ?DateTimeImmutable $fileDate = null; public function __construct( ?string $filename = null, ?string $path = null, ?string $mimeType = null, ?DateTimeImmutable $fileDate = null ) { $this->filename = $filename; $this->path = $path; $this->mimeType = $mimeType; $this->fileDate = $fileDate; } public function getFilename(): ?string { return $this->filename; } public function getPath(): ?string { return $this->path; } public function getMimeType(): ?string { return $this->mimeType; } public function getFileDate(): ?DateTimeImmutable { return $this->fileDate; } }