= startDate */ #[ORM\Column(type: Types::DATETIME_IMMUTABLE)] protected \DateTimeImmutable $endAt; public function __toString(): string { return $this->product->getName().' / '.$this->startAt->format('Y-m-d').' / '.$this->endAt->format('Y-m-d'); } public function getId(): Uuid { return $this->id; } public function setId(Uuid $id): ProductAvailability { $this->id = $id; return $this; } public function getProduct(): Product { return $this->product; } public function setProduct(Product $product): ProductAvailability { $this->product = $product; return $this; } public function getServiceRequest(): ?ServiceRequest { return $this->serviceRequest; } public function setServiceRequest(?ServiceRequest $serviceRequest): ProductAvailability { $this->serviceRequest = $serviceRequest; return $this; } public function getMode(): ProductAvailabilityMode { return $this->mode; } public function setMode(ProductAvailabilityMode $mode): ProductAvailability { $this->mode = $mode; return $this; } public function getType(): ProductAvailabilityType { return $this->type; } public function setType(ProductAvailabilityType $type): ProductAvailability { $this->type = $type; return $this; } public function getStartAt(): \DateTimeImmutable { return $this->startAt; } public function setStartAt(\DateTimeImmutable $startAt): ProductAvailability { $this->startAt = $startAt; return $this; } public function getEndAt(): \DateTimeImmutable { return $this->endAt; } public function setEndAt(\DateTimeImmutable $endAt): ProductAvailability { $this->endAt = $endAt; return $this; } public static function productAvailabilityCreationByOwner(Product $product, \DateTimeImmutable $startAt, \DateTimeImmutable $endAt): ProductAvailability { $productAvailability = new self(); return $productAvailability ->setProduct($product) ->setType(ProductAvailabilityType::OWNER) ->setStartAt($startAt) ->setEndAt($endAt); } }