null])] private ?\DateTimeImmutable $endDate = null; #[ORM\Id] #[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)] #[ORM\GeneratedValue(strategy: 'AUTO')] private ?int $id = null; public function __construct( #[ORM\ManyToOne(targetEntity: AccompanyingPeriod::class, inversedBy: 'userHistories')] #[ORM\JoinColumn(nullable: false)] private ?AccompanyingPeriod $accompanyingPeriod, #[ORM\ManyToOne(targetEntity: User::class)] #[ORM\JoinColumn(nullable: false)] private User $user, #[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: false, options: ['default' => 'now()'])] private \DateTimeImmutable $startDate = new \DateTimeImmutable('now'), ) {} public function getAccompanyingPeriod(): AccompanyingPeriod { return $this->accompanyingPeriod; } public function getEndDate(): ?\DateTimeImmutable { return $this->endDate; } public function getId(): ?int { return $this->id; } public function getStartDate(): \DateTimeImmutable { return $this->startDate; } public function getUser(): User { return $this->user; } public function setEndDate(?\DateTimeImmutable $endDate): UserHistory { $this->endDate = $endDate; return $this; } }