<?phpnamespace Whater\Domain\Media\Model;use BornFree\TacticianDomainEvent\Recorder\ContainsRecordedEvents;use BornFree\TacticianDomainEvent\Recorder\EventRecorderCapabilities;use Ramsey\Uuid\Uuid;use Whater\Domain\Common\Exception\InvalidUUIDException;use Whater\Domain\User\Model\User;use Whater\Domain\Whater\Model\DistributionNetworkValoration;use Whater\Domain\Whater\Model\WhaterValoration;/** * Class DistributionNetworkValorationImage * * @package Whater\Domain\Blog\Model */class DistributionNetworkValorationImage implements ContainsRecordedEvents{ use EventRecorderCapabilities; /** * @var string */ private $uuid; /** * @var null|\DateTime */ private $createdAt; /** * @var null|\DateTime */ private $updatedAt; /** * @var DistributionNetworkValoration */ private $distributionNetworkValoration; /** * @var User */ private $createdBy; /** * @var string */ private $fileName; /** * @var integer */ private $fileSize; /** * @var string */ private $fileMimeType; /** * @var string */ private $fileOriginalname; /** * @var array */ private $fileDimensions; /** * @var File * NOTE: This is not a mapped field of entity metadata, just a simple property. */ private $fileDistributionNetworkValorationImage; public function __construct( string $distributionNetworkValorationImageId = null, DistributionNetworkValoration $distributionNetworkValoration = null, User $createdBy = null ) { try { $this->uuid = Uuid::fromString($distributionNetworkValorationImageId ?: Uuid::uuid4())->toString(); } catch (\InvalidArgumentException $e) { throw new InvalidUUIDException(); } $this->createdAt = new \DateTime(); $this->distributionNetworkValoration = $distributionNetworkValoration; $this->createdBy = $createdBy; $this->updatedAt = new \DateTime(); } public function setData(DistributionNetworkValoration $distributionNetworkValoration, User $createdBy) { $this->distributionNetworkValoration = $distributionNetworkValoration; $this->createdBy = $createdBy; $this->updatedAt = new \DateTime(); } /** * @return string */ public function id(): string { return $this->uuid; } /** * @return \DateTime */ public function createdAt(): \DateTime { return $this->createdAt; } /** * @return \DateTime */ public function updatedAt(): \DateTime { return $this->updatedAt; } /** * @return DistributionNetworkValoration */ public function distributionNetworkValoration(): DistributionNetworkValoration { return $this->distributionNetworkValoration; } /** * @return User|null */ public function createdBy(): ?User { return $this->createdBy; } public function setFileName(?string $fileName): void { $this->fileName = $fileName; } public function getFileName(): ?string { return $this->fileName; } public function setFileSize(?int $fileSize): void { $this->fileSize = $fileSize; } public function getFileSize(): ?int { return $this->fileSize; } public function setFileMimeType(?string $fileMimeType): void { $this->fileMimeType = $fileMimeType; } public function getFileMimeType(): ?string { return $this->fileMimeType; } public function setFileOriginalname(?string $fileOriginalname): void { $this->fileOriginalname = $fileOriginalname; } public function getFileOriginalname(): ?string { return $this->fileOriginalname; } public function setFileDimensions(?array $fileDimensions): void { $this->fileDimensions = $fileDimensions; } public function getFileDimensions(): ?array { return $this->fileDimensions; } public function setFileDistributionNetworkValorationImage($fileDistributionNetworkValorationImage): void { $this->fileDistributionNetworkValorationImage = $fileDistributionNetworkValorationImage; } public function getFileDistributionNetworkValorationImage() { return $this->fileDistributionNetworkValorationImage; } public function serialize() { return serialize(array( $this->uuid )); } public function unserialize($serialized) { list( $this->uuid ) = unserialize($serialized); } /** * @return bool */ public function equals(DistributionNetworkValorationImage $distributionNetworkValorationImage) { return $this->id() === $distributionNetworkValorationImage->id(); }}