diff --git a/src/Bundle/ChillMainBundle/Entity/User/UserJobHistory.php b/src/Bundle/ChillMainBundle/Entity/User/UserJobHistory.php new file mode 100644 index 000000000..233a48e2a --- /dev/null +++ b/src/Bundle/ChillMainBundle/Entity/User/UserJobHistory.php @@ -0,0 +1,107 @@ +endDate; + } + + public function getId(): ?int + { + return $this->id; + } + + public function getJob(): ?UserJob + { + return $this->job; + } + + public function getStartDate(): ?DateTimeImmutable + { + return $this->startDate; + } + + public function getUser(): User + { + return $this->user; + } + + public function setEndDate(?DateTimeImmutable $endDate): self + { + $this->endDate = $endDate; + + return $this; + } + + public function setJob(?UserJob $job): UserJobHistory + { + $this->job = $job; + + return $this; + } + + public function setStartDate(DateTimeImmutable $startDate): self + { + $this->startDate = $startDate; + + return $this; + } + + public function setUser(User $user): UserJobHistory + { + $this->user = $user; + + return $this; + } + +} diff --git a/src/Bundle/ChillMainBundle/Entity/User/UserScopeHistory.php b/src/Bundle/ChillMainBundle/Entity/User/UserScopeHistory.php new file mode 100644 index 000000000..3c4d28d4f --- /dev/null +++ b/src/Bundle/ChillMainBundle/Entity/User/UserScopeHistory.php @@ -0,0 +1,107 @@ +endDate; + } + + public function getId(): ?int + { + return $this->id; + } + + public function getScope(): ?Scope + { + return $this->scope; + } + + public function getStartDate(): ?DateTimeImmutable + { + return $this->startDate; + } + + public function getUser(): User + { + return $this->user; + } + + public function setEndDate(?DateTimeImmutable $endDate): self + { + $this->endDate = $endDate; + + return $this; + } + + public function setScope(?Scope $scope): UserScopeHistory + { + $this->scope = $scope; + + return $this; + } + + public function setStartDate(DateTimeImmutable $startDate): self + { + $this->startDate = $startDate; + + return $this; + } + + public function setUser(User $user): UserScopeHistory + { + $this->user = $user; + + return $this; + } + +} diff --git a/src/Bundle/ChillMainBundle/Repository/User/UserJobHistoryRepository.php b/src/Bundle/ChillMainBundle/Repository/User/UserJobHistoryRepository.php new file mode 100644 index 000000000..a66575e3b --- /dev/null +++ b/src/Bundle/ChillMainBundle/Repository/User/UserJobHistoryRepository.php @@ -0,0 +1,51 @@ +_em->persist($entity); + if ($flush) { + $this->_em->flush(); + } + } + + /** + * @throws ORMException + * @throws OptimisticLockException + */ + public function remove(UserJobHistory $entity, bool $flush = true): void + { + $this->_em->remove($entity); + if ($flush) { + $this->_em->flush(); + } + } + +} diff --git a/src/Bundle/ChillMainBundle/Repository/User/UserScopeHistoryRepository.php b/src/Bundle/ChillMainBundle/Repository/User/UserScopeHistoryRepository.php new file mode 100644 index 000000000..aa6738870 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Repository/User/UserScopeHistoryRepository.php @@ -0,0 +1,51 @@ +_em->persist($entity); + if ($flush) { + $this->_em->flush(); + } + } + + /** + * @throws ORMException + * @throws OptimisticLockException + */ + public function remove(UserScopeHistory $entity, bool $flush = true): void + { + $this->_em->remove($entity); + if ($flush) { + $this->_em->flush(); + } + } + +}