Update schema to store accompanying period work referrer history

This commit is contained in:
2023-10-05 09:33:23 +02:00
parent 239372270e
commit 363785b779
3 changed files with 115 additions and 15 deletions

View File

@@ -38,29 +38,24 @@ class AccompanyingPeriodWorkReferrerHistory implements TrackCreationInterface, T
* @var \DateTimeImmutable|null
* @ORM\Column(type="date_immutable", nullable=true, options={"default": null})
*/
private ?\DateTimeImmutable $endDate;
/**
* @var AccompanyingPeriodWork|null
* @ORM\ManyToOne(targetEntity=AccompanyingPeriodWork::class, inversedBy="referrersHistory")
*/
private ?AccompanyingPeriodWork $accompanyingPeriodWork;
private ?\DateTimeImmutable $endDate = null;
public function __construct(
AccompanyingPeriodWork $accompanyingPeriodWork,
/**
* @ORM\ManyToOne(targetEntity=AccompanyingPeriodWork::class, inversedBy="referrersHistory")
*/
private ?AccompanyingPeriodWork $accompanyingPeriodWork,
/**
* @var User
* @ORM\ManyToOne(targetEntity=User::class)
*/
private readonly User $user,
private User $user,
/**
* @var \DateTimeImmutable
* @ORM\Column(type="date_immutable", nullable=false)
*/
private readonly \DateTimeImmutable $startDate,
) {
$this->accompanyingPeriodWork = $accompanyingPeriodWork;
}
private \DateTimeImmutable $startDate
) {}
public function getId(): ?int
{