/
AleksWork
/
diary_plants
Обзор
Документация
Войти
/
AleksWork
/
diary_plants
Код
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/Domain/ValueObject/Plant/LifeCycle.php
47 строк
1 KB
AlexeySerov
Move some fields from Offspring entity to his VolumeObject
03 мар 2026, 12:32
03 мар 2026, 12:32
adbc28d
Код
Авторство
О чём код?
<?php //жизненный цикл растения namespace App\Domain\ValueObject\Plant; use DateTimeImmutable; use Doctrine\ORM\Mapping as ORM; #[ORM\Embeddable] class LifeCycle { //дата прививки #[ORM\Column(name: 'vaccination_date', type: 'datetimetz_immutable', nullable: true)] private ?DateTimeImmutable $vaccinationDate = null; //дата посадки #[ORM\Column(name: 'planting_date', type: 'datetimetz_immutable', nullable: true)] private ?DateTimeImmutable $plantingDate = null; //описание грунта #[ORM\Column(name: 'soil', type: 'string', length: 1024, nullable: true)] private ?string $soil = null; public function __construct( ?DateTimeImmutable $plantingDate = null, ?DateTimeImmutable $vaccinationDate = null, ?string $soil = null ) { $this->plantingDate = $plantingDate; $this->vaccinationDate = $vaccinationDate; $this->soil = $soil; } public function getVaccinationDate(): ?DateTimeImmutable { return $this->vaccinationDate; } public function getPlantingDate(): ?DateTimeImmutable { return $this->plantingDate; } public function getSoil(): ?string { return $this->soil; } }