From f8c9ff82a5573387764c7ad322f8188e1cc5ec19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Tue, 12 Sep 2023 18:17:24 +0200 Subject: [PATCH] WIP: Implement model --- config/services.yaml | 4 + src/Entity/Application.php | 99 ++++++ src/Entity/Assignment.php | 305 ++++++++++++++++++ src/Entity/Availability.php | 71 ++++ src/Entity/BlameableEntityInterface.php | 14 + src/Entity/Disposition.php | 85 +++++ src/Entity/DispositionRequirement.php | 81 +++++ src/Entity/Faq.php | 71 ++++ src/Entity/Fee.php | 55 ++++ src/Entity/Feedback.php | 130 ++++++++ src/Entity/JobProfile.php | 85 +++++ src/Entity/License.php | 102 ++++++ src/Entity/Period.php | 56 ++++ src/Entity/Pickup.php | 50 +++ src/Entity/Teamer.php | 288 +++++++++++++++++ src/Entity/Training.php | 80 +++++ src/Entity/TrainingAttendance.php | 98 ++++++ src/Entity/Traits/BlameableEntity.php | 38 +++ src/Entity/Upload.php | 148 +++++++++ .../BlamableEntitySubscriber.php | 85 +++++ src/Repository/ApplicationRepository.php | 66 ++++ src/Repository/AssignmentRepository.php | 66 ++++ src/Repository/AvailabilityRepository.php | 66 ++++ src/Repository/DispositionRepository.php | 66 ++++ .../DispositionRequirementRepository.php | 66 ++++ src/Repository/FaqRepository.php | 66 ++++ src/Repository/FeeRepository.php | 66 ++++ src/Repository/FeedbackRepository.php | 66 ++++ src/Repository/JobProfileRepository.php | 66 ++++ src/Repository/LicenseRepository.php | 66 ++++ src/Repository/PeriodRepository.php | 66 ++++ src/Repository/PickupRepository.php | 66 ++++ .../TrainingAttendanceRepository.php | 66 ++++ src/Repository/TrainingRepository.php | 66 ++++ src/Repository/UploadRepository.php | 66 ++++ 35 files changed, 2935 insertions(+) create mode 100644 src/Entity/Application.php create mode 100644 src/Entity/Assignment.php create mode 100644 src/Entity/Availability.php create mode 100644 src/Entity/BlameableEntityInterface.php create mode 100644 src/Entity/Disposition.php create mode 100644 src/Entity/DispositionRequirement.php create mode 100644 src/Entity/Faq.php create mode 100644 src/Entity/Fee.php create mode 100644 src/Entity/Feedback.php create mode 100644 src/Entity/JobProfile.php create mode 100644 src/Entity/License.php create mode 100644 src/Entity/Period.php create mode 100644 src/Entity/Pickup.php create mode 100644 src/Entity/Training.php create mode 100644 src/Entity/TrainingAttendance.php create mode 100644 src/Entity/Traits/BlameableEntity.php create mode 100644 src/Entity/Upload.php create mode 100644 src/EventListener/BlamableEntitySubscriber.php create mode 100644 src/Repository/ApplicationRepository.php create mode 100644 src/Repository/AssignmentRepository.php create mode 100644 src/Repository/AvailabilityRepository.php create mode 100644 src/Repository/DispositionRepository.php create mode 100644 src/Repository/DispositionRequirementRepository.php create mode 100644 src/Repository/FaqRepository.php create mode 100644 src/Repository/FeeRepository.php create mode 100644 src/Repository/FeedbackRepository.php create mode 100644 src/Repository/JobProfileRepository.php create mode 100644 src/Repository/LicenseRepository.php create mode 100644 src/Repository/PeriodRepository.php create mode 100644 src/Repository/PickupRepository.php create mode 100644 src/Repository/TrainingAttendanceRepository.php create mode 100644 src/Repository/TrainingRepository.php create mode 100644 src/Repository/UploadRepository.php diff --git a/config/services.yaml b/config/services.yaml index 16c9545..30b4266 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -19,6 +19,10 @@ services: - '../src/Entity/' - '../src/Kernel.php' + App\EventListener\BlamableEntitySubscriber: + tags: + - { name: 'doctrine.event_subscriber', connection: 'default' } + App\EventListener\TimestampableEntitySubscriber: tags: - { name: 'doctrine.event_subscriber', connection: 'default' } diff --git a/src/Entity/Application.php b/src/Entity/Application.php new file mode 100644 index 0000000..6f35758 --- /dev/null +++ b/src/Entity/Application.php @@ -0,0 +1,99 @@ +id; + } + + public function getAssignment(): ?Assignment + { + return $this->assignment; + } + + public function setAssignment(?Assignment $assignment): static + { + $this->assignment = $assignment; + + return $this; + } + + public function getTeamer(): ?Teamer + { + return $this->teamer; + } + + public function setTeamer(?Teamer $teamer): static + { + $this->teamer = $teamer; + + return $this; + } + + public function getRequests(): ?string + { + return $this->requests; + } + + public function setRequests(?string $requests): static + { + $this->requests = $requests; + + return $this; + } + + public function getStatus(): ?string + { + return $this->status; + } + + public function setStatus(string $status): static + { + $this->status = $status; + + return $this; + } + + public function getRemarks(): ?string + { + return $this->remarks; + } + + public function setRemarks(?string $remarks): static + { + $this->remarks = $remarks; + + return $this; + } +} diff --git a/src/Entity/Assignment.php b/src/Entity/Assignment.php new file mode 100644 index 0000000..b5b77a2 --- /dev/null +++ b/src/Entity/Assignment.php @@ -0,0 +1,305 @@ +uuid = Uuid::v4(); + $this->pickups = new ArrayCollection(); + $this->fees = new ArrayCollection(); + $this->applications = new ArrayCollection(); + $this->dispositions = new ArrayCollection(); + $this->requirements = new ArrayCollection(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function getUuid(): string + { + return $this->uuid; + } + + public function getBusProCode(): ?string + { + return $this->busProCode; + } + + public function setBusProCode(string $busProCode): static + { + $this->busProCode = $busProCode; + + return $this; + } + + public function getAvailable(): ?int + { + return $this->available; + } + + public function setAvailable(int $available): static + { + $this->available = $available; + + return $this; + } + + public function getDateFrom(): ?\DateTimeImmutable + { + return $this->dateFrom; + } + + public function setDateFrom(\DateTimeImmutable $dateFrom): static + { + $this->dateFrom = $dateFrom; + + return $this; + } + + public function getDateTo(): ?\DateTimeImmutable + { + return $this->dateTo; + } + + public function setDateTo(\DateTimeImmutable $dateTo): static + { + $this->dateTo = $dateTo; + + return $this; + } + + public function getBenefits(): ?string + { + return $this->benefits; + } + + public function setBenefits(string $benefits): static + { + $this->benefits = $benefits; + + return $this; + } + + public function getRemarks(): ?string + { + return $this->remarks; + } + + public function setRemarks(?string $remarks): static + { + $this->remarks = $remarks; + + return $this; + } + + public function getOwner(): ?User + { + return $this->owner; + } + + public function setOwner(?User $owner): static + { + $this->owner = $owner; + + return $this; + } + + /** + * @return Collection + */ + public function getPickups(): Collection + { + return $this->pickups; + } + + public function addPickup(Pickup $pickup): static + { + if (!$this->pickups->contains($pickup)) { + $this->pickups->add($pickup); + } + + return $this; + } + + public function removePickup(Pickup $pickup): static + { + $this->pickups->removeElement($pickup); + + return $this; + } + + /** + * @return Collection + */ + public function getFees(): Collection + { + return $this->fees; + } + + public function addFee(Fee $fee): static + { + if (!$this->fees->contains($fee)) { + $this->fees->add($fee); + } + + return $this; + } + + public function removeFee(Fee $fee): static + { + $this->fees->removeElement($fee); + + return $this; + } + + /** + * @return Collection + */ + public function getApplications(): Collection + { + return $this->applications; + } + + public function addApplication(Application $application): static + { + if (!$this->applications->contains($application)) { + $this->applications->add($application); + $application->setAssignment($this); + } + + return $this; + } + + public function removeApplication(Application $application): static + { + if ($this->applications->removeElement($application)) { + // set the owning side to null (unless already changed) + if ($application->getAssignment() === $this) { + $application->setAssignment(null); + } + } + + return $this; + } + + /** + * @return Collection + */ + public function getDispositions(): Collection + { + return $this->dispositions; + } + + public function addDisposition(Disposition $disposition): static + { + if (!$this->dispositions->contains($disposition)) { + $this->dispositions->add($disposition); + $disposition->setAssignment($this); + } + + return $this; + } + + public function removeDisposition(Disposition $disposition): static + { + if ($this->dispositions->removeElement($disposition)) { + // set the owning side to null (unless already changed) + if ($disposition->getAssignment() === $this) { + $disposition->setAssignment(null); + } + } + + return $this; + } + + /** + * @return Collection + */ + public function getRequirements(): Collection + { + return $this->requirements; + } + + public function addRequirement(DispositionRequirement $requirement): static + { + if (!$this->requirements->contains($requirement)) { + $this->requirements->add($requirement); + $requirement->setAssignment($this); + } + + return $this; + } + + public function removeRequirement(DispositionRequirement $requirement): static + { + if ($this->requirements->removeElement($requirement)) { + // set the owning side to null (unless already changed) + if ($requirement->getAssignment() === $this) { + $requirement->setAssignment(null); + } + } + + return $this; + } +} diff --git a/src/Entity/Availability.php b/src/Entity/Availability.php new file mode 100644 index 0000000..e65d236 --- /dev/null +++ b/src/Entity/Availability.php @@ -0,0 +1,71 @@ +id; + } + + public function getDateFrom(): ?\DateTimeImmutable + { + return $this->dateFrom; + } + + public function setDateFrom(\DateTimeImmutable $dateFrom): static + { + $this->dateFrom = $dateFrom; + + return $this; + } + + public function getDateTo(): ?\DateTimeImmutable + { + return $this->dateTo; + } + + public function setDateTo(\DateTimeImmutable $dateTo): static + { + $this->dateTo = $dateTo; + + return $this; + } + + public function getOwner(): ?Teamer + { + return $this->owner; + } + + public function setOwner(?Teamer $owner): static + { + $this->owner = $owner; + + return $this; + } +} diff --git a/src/Entity/BlameableEntityInterface.php b/src/Entity/BlameableEntityInterface.php new file mode 100644 index 0000000..9c70d2b --- /dev/null +++ b/src/Entity/BlameableEntityInterface.php @@ -0,0 +1,14 @@ +uuid = Uuid::v4(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function getUuid(): string + { + return $this->uuid; + } + + public function getAssignment(): ?Assignment + { + return $this->assignment; + } + + public function setAssignment(?Assignment $assignment): static + { + $this->assignment = $assignment; + + return $this; + } + + public function getTeamer(): ?Teamer + { + return $this->teamer; + } + + public function setTeamer(?Teamer $teamer): static + { + $this->teamer = $teamer; + + return $this; + } + + public function getRemarks(): ?string + { + return $this->remarks; + } + + public function setRemarks(?string $remarks): static + { + $this->remarks = $remarks; + + return $this; + } +} diff --git a/src/Entity/DispositionRequirement.php b/src/Entity/DispositionRequirement.php new file mode 100644 index 0000000..1164200 --- /dev/null +++ b/src/Entity/DispositionRequirement.php @@ -0,0 +1,81 @@ +id; + } + + public function getTraining(): ?Training + { + return $this->training; + } + + public function setTraining(?Training $training): static + { + $this->training = $training; + + return $this; + } + + public function getPickup(): ?Pickup + { + return $this->pickup; + } + + public function setPickup(?Pickup $pickup): static + { + $this->pickup = $pickup; + + return $this; + } + + public function getPickupDate(): ?\DateTimeImmutable + { + return $this->pickupDate; + } + + public function setPickupDate(?\DateTimeImmutable $pickupDate): static + { + $this->pickupDate = $pickupDate; + + return $this; + } + + public function getAssignment(): ?Assignment + { + return $this->assignment; + } + + public function setAssignment(?Assignment $assignment): static + { + $this->assignment = $assignment; + + return $this; + } +} diff --git a/src/Entity/Faq.php b/src/Entity/Faq.php new file mode 100644 index 0000000..eca5a6e --- /dev/null +++ b/src/Entity/Faq.php @@ -0,0 +1,71 @@ +id; + } + + public function getQuestion(): ?string + { + return $this->question; + } + + public function setQuestion(string $question): static + { + $this->question = $question; + + return $this; + } + + public function getAnswer(): ?string + { + return $this->answer; + } + + public function setAnswer(string $answer): static + { + $this->answer = $answer; + + return $this; + } + + public function getSorting(): ?int + { + return $this->sorting; + } + + public function setSorting(int $sorting): static + { + $this->sorting = $sorting; + + return $this; + } +} diff --git a/src/Entity/Fee.php b/src/Entity/Fee.php new file mode 100644 index 0000000..50e423f --- /dev/null +++ b/src/Entity/Fee.php @@ -0,0 +1,55 @@ +id; + } + + public function getValue(): ?int + { + return $this->value; + } + + public function setValue(int $value): static + { + $this->value = $value; + + return $this; + } + + public function getName(): ?string + { + return $this->name; + } + + public function setName(string $name): static + { + $this->name = $name; + + return $this; + } +} diff --git a/src/Entity/Feedback.php b/src/Entity/Feedback.php new file mode 100644 index 0000000..b6fd600 --- /dev/null +++ b/src/Entity/Feedback.php @@ -0,0 +1,130 @@ +uuid = Uuid::v4(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function getUuid(): string + { + return $this->uuid; + } + + public function getTeamer(): ?Teamer + { + return $this->teamer; + } + + public function setTeamer(?Teamer $teamer): static + { + $this->teamer = $teamer; + + return $this; + } + + public function getBody(): ?string + { + return $this->body; + } + + public function setBody(string $body): static + { + $this->body = $body; + + return $this; + } + + public function getAssignmentDestination(): ?string + { + return $this->assignmentDestination; + } + + public function setAssignmentDestination(string $assignmentDestination): static + { + $this->assignmentDestination = $assignmentDestination; + + return $this; + } + + public function getAssignmentDate(): ?\DateTimeImmutable + { + return $this->assignmentDate; + } + + public function setAssignmentDate(\DateTimeImmutable $assignmentDate): static + { + $this->assignmentDate = $assignmentDate; + + return $this; + } + + public function getAuthorName(): ?string + { + return $this->authorName; + } + + public function setAuthorName(string $authorName): static + { + $this->authorName = $authorName; + + return $this; + } + + public function getAuthorEmail(): ?string + { + return $this->authorEmail; + } + + public function setAuthorEmail(string $authorEmail): static + { + $this->authorEmail = $authorEmail; + + return $this; + } +} diff --git a/src/Entity/JobProfile.php b/src/Entity/JobProfile.php new file mode 100644 index 0000000..3b8d4f6 --- /dev/null +++ b/src/Entity/JobProfile.php @@ -0,0 +1,85 @@ +uuid = Uuid::v4(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function getUuid(): string + { + return $this->uuid; + } + + public function getName(): ?string + { + return $this->name; + } + + public function setName(string $name): static + { + $this->name = $name; + + return $this; + } + + public function getRequiredTraining(): ?Training + { + return $this->requiredTraining; + } + + public function setRequiredTraining(?Training $requiredTraining): static + { + $this->requiredTraining = $requiredTraining; + + return $this; + } + + public function getRequiredLicenses(): array + { + return $this->requiredLicenses; + } + + public function setRequiredLicenses(array $requiredLicenses): static + { + $this->requiredLicenses = $requiredLicenses; + + return $this; + } +} diff --git a/src/Entity/License.php b/src/Entity/License.php new file mode 100644 index 0000000..4b81d66 --- /dev/null +++ b/src/Entity/License.php @@ -0,0 +1,102 @@ +uuid = Uuid::v4(); + $this->type = static::TYPE_SKI; + } + + public function getId(): ?int + { + return $this->id; + } + + public function getUuid(): string + { + return $this->uuid; + } + + public function getType(): ?string + { + return $this->type; + } + + public function setType(string $type): static + { + $this->type = $type; + + return $this; + } + + public function getDate(): ?\DateTimeImmutable + { + return $this->date; + } + + public function setDate(\DateTimeImmutable $date): static + { + $this->date = $date; + + return $this; + } + + public function getCertificate(): ?Upload + { + return $this->certificate; + } + + public function setCertificate(?Upload $certificate): static + { + $this->certificate = $certificate; + + return $this; + } + + public function getTeamer(): ?Teamer + { + return $this->teamer; + } + + public function setTeamer(?Teamer $teamer): static + { + $this->teamer = $teamer; + + return $this; + } +} diff --git a/src/Entity/Period.php b/src/Entity/Period.php new file mode 100644 index 0000000..9fbe3af --- /dev/null +++ b/src/Entity/Period.php @@ -0,0 +1,56 @@ +id; + } + + public function getDateFrom(): ?\DateTimeImmutable + { + return $this->dateFrom; + } + + public function setDateFrom(\DateTimeImmutable $dateFrom): static + { + $this->dateFrom = $dateFrom; + + return $this; + } + + public function getDateTo(): ?\DateTimeImmutable + { + return $this->dateTo; + } + + public function setDateTo(\DateTimeImmutable $dateTo): static + { + $this->dateTo = $dateTo; + + return $this; + } +} diff --git a/src/Entity/Pickup.php b/src/Entity/Pickup.php new file mode 100644 index 0000000..6eb9a06 --- /dev/null +++ b/src/Entity/Pickup.php @@ -0,0 +1,50 @@ +id; + } + + public function getName(): ?string + { + return $this->name; + } + + public function setName(string $name): static + { + $this->name = $name; + + return $this; + } + + public function getBusProId(): ?int + { + return $this->busProId; + } + + public function setBusProId(int $busProId): static + { + $this->busProId = $busProId; + + return $this; + } +} diff --git a/src/Entity/Teamer.php b/src/Entity/Teamer.php index abfb680..be78ff9 100644 --- a/src/Entity/Teamer.php +++ b/src/Entity/Teamer.php @@ -8,6 +8,8 @@ use App\Entity\Embeddable\BankAccount; use App\Entity\Embeddable\Communication; use App\Entity\Traits\TimestampableEntity; use App\Repository\TeamerRepository; +use Doctrine\Common\Collections\ArrayCollection; +use Doctrine\Common\Collections\Collection; use Doctrine\DBAL\Types\Types; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Uid\Uuid; @@ -74,10 +76,45 @@ class Teamer implements TimestampableEntityInterface #[ORM\Column(type: Types::TEXT, nullable: true)] private ?string $remarks = null; + #[ORM\OneToMany(mappedBy: 'owner', targetEntity: Availability::class)] + private Collection $availabilities; + + #[ORM\OneToOne(cascade: ['persist', 'remove'])] + private ?Upload $photo = null; + + #[ORM\OneToMany(mappedBy: 'teamer', targetEntity: Feedback::class)] + private Collection $feedback; + + #[ORM\OneToMany(mappedBy: 'teamer', targetEntity: TrainingAttendance::class)] + private Collection $trainingAttendances; + + #[ORM\OneToMany(mappedBy: 'teamer', targetEntity: License::class)] + private Collection $licenses; + + #[ORM\ManyToMany(targetEntity: JobProfile::class)] + private Collection $jobProfiles; + + #[ORM\ManyToMany(targetEntity: Assignment::class)] + private Collection $bookmarks; + + #[ORM\OneToMany(mappedBy: 'teamer', targetEntity: Application::class)] + private Collection $applications; + + #[ORM\OneToMany(mappedBy: 'teamer', targetEntity: Disposition::class)] + private Collection $dispositions; + public function __construct() { $this->uuid = Uuid::v4(); $this->status = static::STATUS_NEW; + $this->availabilities = new ArrayCollection(); + $this->feedback = new ArrayCollection(); + $this->trainingAttendances = new ArrayCollection(); + $this->licenses = new ArrayCollection(); + $this->jobProfiles = new ArrayCollection(); + $this->bookmarks = new ArrayCollection(); + $this->applications = new ArrayCollection(); + $this->dispositions = new ArrayCollection(); } public static function fromApiResponse(ProfileResponse $profileResponse): static @@ -281,4 +318,255 @@ class Teamer implements TimestampableEntityInterface return $this; } + + /** + * @return Collection + */ + public function getAvailabilities(): Collection + { + return $this->availabilities; + } + + public function addAvailability(Availability $availability): static + { + if (!$this->availabilities->contains($availability)) { + $this->availabilities->add($availability); + $availability->setOwner($this); + } + + return $this; + } + + public function removeAvailability(Availability $availability): static + { + if ($this->availabilities->removeElement($availability)) { + // set the owning side to null (unless already changed) + if ($availability->getOwner() === $this) { + $availability->setOwner(null); + } + } + + return $this; + } + + public function getPhoto(): ?Upload + { + return $this->photo; + } + + public function setPhoto(?Upload $photo): static + { + $this->photo = $photo; + + return $this; + } + + /** + * @return Collection + */ + public function getFeedback(): Collection + { + return $this->feedback; + } + + public function addFeedback(Feedback $feedback): static + { + if (!$this->feedback->contains($feedback)) { + $this->feedback->add($feedback); + $feedback->setTeamer($this); + } + + return $this; + } + + public function removeFeedback(Feedback $feedback): static + { + if ($this->feedback->removeElement($feedback)) { + // set the owning side to null (unless already changed) + if ($feedback->getTeamer() === $this) { + $feedback->setTeamer(null); + } + } + + return $this; + } + + /** + * @return Collection + */ + public function getTrainingAttendances(): Collection + { + return $this->trainingAttendances; + } + + public function addTrainingAttendance(TrainingAttendance $trainingAttendance): static + { + if (!$this->trainingAttendances->contains($trainingAttendance)) { + $this->trainingAttendances->add($trainingAttendance); + $trainingAttendance->setTeamer($this); + } + + return $this; + } + + public function removeTrainingAttendance(TrainingAttendance $trainingAttendance): static + { + if ($this->trainingAttendances->removeElement($trainingAttendance)) { + // set the owning side to null (unless already changed) + if ($trainingAttendance->getTeamer() === $this) { + $trainingAttendance->setTeamer(null); + } + } + + return $this; + } + + /** + * @return Collection + */ + public function getLicenses(): Collection + { + return $this->licenses; + } + + public function addLicense(License $license): static + { + if (!$this->licenses->contains($license)) { + $this->licenses->add($license); + $license->setTeamer($this); + } + + return $this; + } + + public function removeLicense(License $license): static + { + if ($this->licenses->removeElement($license)) { + // set the owning side to null (unless already changed) + if ($license->getTeamer() === $this) { + $license->setTeamer(null); + } + } + + return $this; + } + + public function hasLicenseOfType(string $type): bool + { + foreach ($this->getLicenses() as $license) { + if ($type === $license->getType()) { + return true; + } + } + + return false; + } + + /** + * @return Collection + */ + public function getJobProfiles(): Collection + { + return $this->jobProfiles; + } + + public function addJobProfile(JobProfile $jobProfile): static + { + if (!$this->jobProfiles->contains($jobProfile)) { + $this->jobProfiles->add($jobProfile); + } + + return $this; + } + + public function removeJobProfile(JobProfile $jobProfile): static + { + $this->jobProfiles->removeElement($jobProfile); + + return $this; + } + + /** + * @return Collection + */ + public function getBookmarks(): Collection + { + return $this->bookmarks; + } + + public function addBookmark(Assignment $bookmark): static + { + if (!$this->bookmarks->contains($bookmark)) { + $this->bookmarks->add($bookmark); + } + + return $this; + } + + public function removeBookmark(Assignment $bookmark): static + { + $this->bookmarks->removeElement($bookmark); + + return $this; + } + + /** + * @return Collection + */ + public function getApplications(): Collection + { + return $this->applications; + } + + public function addApplication(Application $application): static + { + if (!$this->applications->contains($application)) { + $this->applications->add($application); + $application->setTeamer($this); + } + + return $this; + } + + public function removeApplication(Application $application): static + { + if ($this->applications->removeElement($application)) { + // set the owning side to null (unless already changed) + if ($application->getTeamer() === $this) { + $application->setTeamer(null); + } + } + + return $this; + } + + /** + * @return Collection + */ + public function getDispositions(): Collection + { + return $this->dispositions; + } + + public function addDisposition(Disposition $disposition): static + { + if (!$this->dispositions->contains($disposition)) { + $this->dispositions->add($disposition); + $disposition->setTeamer($this); + } + + return $this; + } + + public function removeDisposition(Disposition $disposition): static + { + if ($this->dispositions->removeElement($disposition)) { + // set the owning side to null (unless already changed) + if ($disposition->getTeamer() === $this) { + $disposition->setTeamer(null); + } + } + + return $this; + } } diff --git a/src/Entity/Training.php b/src/Entity/Training.php new file mode 100644 index 0000000..05fa343 --- /dev/null +++ b/src/Entity/Training.php @@ -0,0 +1,80 @@ +trainingAttendances = new ArrayCollection(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function getName(): ?string + { + return $this->name; + } + + public function setName(string $name): static + { + $this->name = $name; + + return $this; + } + + /** + * @return Collection + */ + public function getTrainingAttendances(): Collection + { + return $this->trainingAttendances; + } + + public function addTrainingAttendance(TrainingAttendance $trainingAttendance): static + { + if (!$this->trainingAttendances->contains($trainingAttendance)) { + $this->trainingAttendances->add($trainingAttendance); + $trainingAttendance->setTraining($this); + } + + return $this; + } + + public function removeTrainingAttendance(TrainingAttendance $trainingAttendance): static + { + if ($this->trainingAttendances->removeElement($trainingAttendance)) { + // set the owning side to null (unless already changed) + if ($trainingAttendance->getTraining() === $this) { + $trainingAttendance->setTraining(null); + } + } + + return $this; + } +} diff --git a/src/Entity/TrainingAttendance.php b/src/Entity/TrainingAttendance.php new file mode 100644 index 0000000..6eb9315 --- /dev/null +++ b/src/Entity/TrainingAttendance.php @@ -0,0 +1,98 @@ +uuid = Uuid::v4(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function getUuid(): string + { + return $this->uuid; + } + + public function getTraining(): ?Training + { + return $this->training; + } + + public function setTraining(?Training $training): static + { + $this->training = $training; + + return $this; + } + + public function getDate(): ?\DateTimeImmutable + { + return $this->date; + } + + public function setDate(\DateTimeImmutable $date): static + { + $this->date = $date; + + return $this; + } + + public function getCertificate(): ?Upload + { + return $this->certificate; + } + + public function setCertificate(?Upload $certificate): static + { + $this->certificate = $certificate; + + return $this; + } + + public function getTeamer(): ?Teamer + { + return $this->teamer; + } + + public function setTeamer(?Teamer $teamer): static + { + $this->teamer = $teamer; + + return $this; + } +} diff --git a/src/Entity/Traits/BlameableEntity.php b/src/Entity/Traits/BlameableEntity.php new file mode 100644 index 0000000..72306b5 --- /dev/null +++ b/src/Entity/Traits/BlameableEntity.php @@ -0,0 +1,38 @@ +createdBy; + } + + public function setCreatedBy(string $createdBy): static + { + $this->createdBy = $createdBy; + + return $this; + } + + public function getUpdatedBy(): ?string + { + return $this->updatedBy; + } + + public function setUpdatedBy(string $updatedBy): static + { + $this->updatedBy = $updatedBy; + + return $this; + } +} diff --git a/src/Entity/Upload.php b/src/Entity/Upload.php new file mode 100644 index 0000000..be09e56 --- /dev/null +++ b/src/Entity/Upload.php @@ -0,0 +1,148 @@ +uuid = Uuid::v4(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function getUuid(): string + { + return $this->uuid; + } + + public function getType(): ?string + { + return $this->type; + } + + public function setType(string $type): static + { + $this->type = $type; + + return $this; + } + + public function getStatus(): ?string + { + return $this->status; + } + + public function setStatus(?string $status): static + { + $this->status = $status; + + return $this; + } + + public function getFilename(): ?string + { + return $this->filename; + } + + public function setFilename(string $filename): static + { + $this->filename = $filename; + + return $this; + } + + public function getOriginalFilename(): ?string + { + return $this->originalFilename; + } + + public function setOriginalFilename(string $originalFilename): static + { + $this->originalFilename = $originalFilename; + + return $this; + } + + public function getSize(): ?int + { + return $this->size; + } + + public function setSize(int $size): static + { + $this->size = $size; + + return $this; + } + + public function getMimeType(): ?string + { + return $this->mimeType; + } + + public function setMimeType(string $mimeType): static + { + $this->mimeType = $mimeType; + + return $this; + } + + public function getOwner(): ?User + { + return $this->owner; + } + + public function setOwner(?User $owner): static + { + $this->owner = $owner; + + return $this; + } +} diff --git a/src/EventListener/BlamableEntitySubscriber.php b/src/EventListener/BlamableEntitySubscriber.php new file mode 100644 index 0000000..96d6b9d --- /dev/null +++ b/src/EventListener/BlamableEntitySubscriber.php @@ -0,0 +1,85 @@ +getObject(); + + if (!$entity instanceof BlameableEntityInterface) { + return; + } + + $entity->setCreatedBy($this->getUserName()); + } + + public function preUpdate(PreUpdateEventArgs $args): void + { + $entity = $args->getObject(); + + if (!$entity instanceof BlameableEntityInterface) { + return; + } + + $changeSet = []; + foreach ($args->getEntityChangeSet() as $prop => $value) { + if (in_array($prop, static::$ignoredProperties, true)) { + continue; + } + $changeSet[] = $prop; + } + + if (0 === count($changeSet)) { + return; + } + + $entity->setUpdatedBy($this->getUserName()); + } + + private function getUserName(): string + { + $user = $this->security->getUser(); + + if (null === $user) { + return 'system'; + } + + if ($user instanceof UserInterface) { + return $user->getUserIdentifier(); + } + + return (string) $user; + } +} diff --git a/src/Repository/ApplicationRepository.php b/src/Repository/ApplicationRepository.php new file mode 100644 index 0000000..943595b --- /dev/null +++ b/src/Repository/ApplicationRepository.php @@ -0,0 +1,66 @@ + + * + * @method Application|null find($id, $lockMode = null, $lockVersion = null) + * @method Application|null findOneBy(array $criteria, array $orderBy = null) + * @method Application[] findAll() + * @method Application[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class ApplicationRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Application::class); + } + + public function save(Application $entity, bool $flush = false): void + { + $this->getEntityManager()->persist($entity); + + if ($flush) { + $this->getEntityManager()->flush(); + } + } + + public function remove(Application $entity, bool $flush = false): void + { + $this->getEntityManager()->remove($entity); + + if ($flush) { + $this->getEntityManager()->flush(); + } + } + +// /** +// * @return Application[] Returns an array of Application objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('a') +// ->andWhere('a.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('a.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?Application +// { +// return $this->createQueryBuilder('a') +// ->andWhere('a.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +} diff --git a/src/Repository/AssignmentRepository.php b/src/Repository/AssignmentRepository.php new file mode 100644 index 0000000..c69b489 --- /dev/null +++ b/src/Repository/AssignmentRepository.php @@ -0,0 +1,66 @@ + + * + * @method Assignment|null find($id, $lockMode = null, $lockVersion = null) + * @method Assignment|null findOneBy(array $criteria, array $orderBy = null) + * @method Assignment[] findAll() + * @method Assignment[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class AssignmentRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Assignment::class); + } + + public function save(Assignment $entity, bool $flush = false): void + { + $this->getEntityManager()->persist($entity); + + if ($flush) { + $this->getEntityManager()->flush(); + } + } + + public function remove(Assignment $entity, bool $flush = false): void + { + $this->getEntityManager()->remove($entity); + + if ($flush) { + $this->getEntityManager()->flush(); + } + } + +// /** +// * @return Assignment[] Returns an array of Assignment objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('a') +// ->andWhere('a.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('a.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?Assignment +// { +// return $this->createQueryBuilder('a') +// ->andWhere('a.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +} diff --git a/src/Repository/AvailabilityRepository.php b/src/Repository/AvailabilityRepository.php new file mode 100644 index 0000000..21d6cba --- /dev/null +++ b/src/Repository/AvailabilityRepository.php @@ -0,0 +1,66 @@ + + * + * @method Availability|null find($id, $lockMode = null, $lockVersion = null) + * @method Availability|null findOneBy(array $criteria, array $orderBy = null) + * @method Availability[] findAll() + * @method Availability[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class AvailabilityRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Availability::class); + } + + public function save(Availability $entity, bool $flush = false): void + { + $this->getEntityManager()->persist($entity); + + if ($flush) { + $this->getEntityManager()->flush(); + } + } + + public function remove(Availability $entity, bool $flush = false): void + { + $this->getEntityManager()->remove($entity); + + if ($flush) { + $this->getEntityManager()->flush(); + } + } + +// /** +// * @return Availability[] Returns an array of Availability objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('a') +// ->andWhere('a.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('a.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?Availability +// { +// return $this->createQueryBuilder('a') +// ->andWhere('a.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +} diff --git a/src/Repository/DispositionRepository.php b/src/Repository/DispositionRepository.php new file mode 100644 index 0000000..0abfbd5 --- /dev/null +++ b/src/Repository/DispositionRepository.php @@ -0,0 +1,66 @@ + + * + * @method Disposition|null find($id, $lockMode = null, $lockVersion = null) + * @method Disposition|null findOneBy(array $criteria, array $orderBy = null) + * @method Disposition[] findAll() + * @method Disposition[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class DispositionRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Disposition::class); + } + + public function save(Disposition $entity, bool $flush = false): void + { + $this->getEntityManager()->persist($entity); + + if ($flush) { + $this->getEntityManager()->flush(); + } + } + + public function remove(Disposition $entity, bool $flush = false): void + { + $this->getEntityManager()->remove($entity); + + if ($flush) { + $this->getEntityManager()->flush(); + } + } + +// /** +// * @return Disposition[] Returns an array of Disposition objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('d') +// ->andWhere('d.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('d.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?Disposition +// { +// return $this->createQueryBuilder('d') +// ->andWhere('d.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +} diff --git a/src/Repository/DispositionRequirementRepository.php b/src/Repository/DispositionRequirementRepository.php new file mode 100644 index 0000000..298db93 --- /dev/null +++ b/src/Repository/DispositionRequirementRepository.php @@ -0,0 +1,66 @@ + + * + * @method DispositionRequirement|null find($id, $lockMode = null, $lockVersion = null) + * @method DispositionRequirement|null findOneBy(array $criteria, array $orderBy = null) + * @method DispositionRequirement[] findAll() + * @method DispositionRequirement[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class DispositionRequirementRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, DispositionRequirement::class); + } + + public function save(DispositionRequirement $entity, bool $flush = false): void + { + $this->getEntityManager()->persist($entity); + + if ($flush) { + $this->getEntityManager()->flush(); + } + } + + public function remove(DispositionRequirement $entity, bool $flush = false): void + { + $this->getEntityManager()->remove($entity); + + if ($flush) { + $this->getEntityManager()->flush(); + } + } + +// /** +// * @return DispositionRequirement[] Returns an array of DispositionRequirement objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('d') +// ->andWhere('d.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('d.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?DispositionRequirement +// { +// return $this->createQueryBuilder('d') +// ->andWhere('d.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +} diff --git a/src/Repository/FaqRepository.php b/src/Repository/FaqRepository.php new file mode 100644 index 0000000..42586bf --- /dev/null +++ b/src/Repository/FaqRepository.php @@ -0,0 +1,66 @@ + + * + * @method Faq|null find($id, $lockMode = null, $lockVersion = null) + * @method Faq|null findOneBy(array $criteria, array $orderBy = null) + * @method Faq[] findAll() + * @method Faq[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class FaqRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Faq::class); + } + + public function save(Faq $entity, bool $flush = false): void + { + $this->getEntityManager()->persist($entity); + + if ($flush) { + $this->getEntityManager()->flush(); + } + } + + public function remove(Faq $entity, bool $flush = false): void + { + $this->getEntityManager()->remove($entity); + + if ($flush) { + $this->getEntityManager()->flush(); + } + } + +// /** +// * @return Faq[] Returns an array of Faq objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('f') +// ->andWhere('f.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('f.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?Faq +// { +// return $this->createQueryBuilder('f') +// ->andWhere('f.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +} diff --git a/src/Repository/FeeRepository.php b/src/Repository/FeeRepository.php new file mode 100644 index 0000000..4fde4d7 --- /dev/null +++ b/src/Repository/FeeRepository.php @@ -0,0 +1,66 @@ + + * + * @method Fee|null find($id, $lockMode = null, $lockVersion = null) + * @method Fee|null findOneBy(array $criteria, array $orderBy = null) + * @method Fee[] findAll() + * @method Fee[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class FeeRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Fee::class); + } + + public function save(Fee $entity, bool $flush = false): void + { + $this->getEntityManager()->persist($entity); + + if ($flush) { + $this->getEntityManager()->flush(); + } + } + + public function remove(Fee $entity, bool $flush = false): void + { + $this->getEntityManager()->remove($entity); + + if ($flush) { + $this->getEntityManager()->flush(); + } + } + +// /** +// * @return Fee[] Returns an array of Fee objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('f') +// ->andWhere('f.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('f.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?Fee +// { +// return $this->createQueryBuilder('f') +// ->andWhere('f.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +} diff --git a/src/Repository/FeedbackRepository.php b/src/Repository/FeedbackRepository.php new file mode 100644 index 0000000..9bc8c22 --- /dev/null +++ b/src/Repository/FeedbackRepository.php @@ -0,0 +1,66 @@ + + * + * @method Feedback|null find($id, $lockMode = null, $lockVersion = null) + * @method Feedback|null findOneBy(array $criteria, array $orderBy = null) + * @method Feedback[] findAll() + * @method Feedback[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class FeedbackRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Feedback::class); + } + + public function save(Feedback $entity, bool $flush = false): void + { + $this->getEntityManager()->persist($entity); + + if ($flush) { + $this->getEntityManager()->flush(); + } + } + + public function remove(Feedback $entity, bool $flush = false): void + { + $this->getEntityManager()->remove($entity); + + if ($flush) { + $this->getEntityManager()->flush(); + } + } + +// /** +// * @return Feedback[] Returns an array of Feedback objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('f') +// ->andWhere('f.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('f.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?Feedback +// { +// return $this->createQueryBuilder('f') +// ->andWhere('f.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +} diff --git a/src/Repository/JobProfileRepository.php b/src/Repository/JobProfileRepository.php new file mode 100644 index 0000000..dcd0f51 --- /dev/null +++ b/src/Repository/JobProfileRepository.php @@ -0,0 +1,66 @@ + + * + * @method JobProfile|null find($id, $lockMode = null, $lockVersion = null) + * @method JobProfile|null findOneBy(array $criteria, array $orderBy = null) + * @method JobProfile[] findAll() + * @method JobProfile[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class JobProfileRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, JobProfile::class); + } + + public function save(JobProfile $entity, bool $flush = false): void + { + $this->getEntityManager()->persist($entity); + + if ($flush) { + $this->getEntityManager()->flush(); + } + } + + public function remove(JobProfile $entity, bool $flush = false): void + { + $this->getEntityManager()->remove($entity); + + if ($flush) { + $this->getEntityManager()->flush(); + } + } + +// /** +// * @return JobProfile[] Returns an array of JobProfile objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('j') +// ->andWhere('j.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('j.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?JobProfile +// { +// return $this->createQueryBuilder('j') +// ->andWhere('j.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +} diff --git a/src/Repository/LicenseRepository.php b/src/Repository/LicenseRepository.php new file mode 100644 index 0000000..ee6599f --- /dev/null +++ b/src/Repository/LicenseRepository.php @@ -0,0 +1,66 @@ + + * + * @method License|null find($id, $lockMode = null, $lockVersion = null) + * @method License|null findOneBy(array $criteria, array $orderBy = null) + * @method License[] findAll() + * @method License[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class LicenseRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, License::class); + } + + public function save(License $entity, bool $flush = false): void + { + $this->getEntityManager()->persist($entity); + + if ($flush) { + $this->getEntityManager()->flush(); + } + } + + public function remove(License $entity, bool $flush = false): void + { + $this->getEntityManager()->remove($entity); + + if ($flush) { + $this->getEntityManager()->flush(); + } + } + +// /** +// * @return License[] Returns an array of License objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('l') +// ->andWhere('l.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('l.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?License +// { +// return $this->createQueryBuilder('l') +// ->andWhere('l.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +} diff --git a/src/Repository/PeriodRepository.php b/src/Repository/PeriodRepository.php new file mode 100644 index 0000000..114767d --- /dev/null +++ b/src/Repository/PeriodRepository.php @@ -0,0 +1,66 @@ + + * + * @method Period|null find($id, $lockMode = null, $lockVersion = null) + * @method Period|null findOneBy(array $criteria, array $orderBy = null) + * @method Period[] findAll() + * @method Period[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class PeriodRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Period::class); + } + + public function save(Period $entity, bool $flush = false): void + { + $this->getEntityManager()->persist($entity); + + if ($flush) { + $this->getEntityManager()->flush(); + } + } + + public function remove(Period $entity, bool $flush = false): void + { + $this->getEntityManager()->remove($entity); + + if ($flush) { + $this->getEntityManager()->flush(); + } + } + +// /** +// * @return Period[] Returns an array of Period objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('p') +// ->andWhere('p.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('p.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?Period +// { +// return $this->createQueryBuilder('p') +// ->andWhere('p.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +} diff --git a/src/Repository/PickupRepository.php b/src/Repository/PickupRepository.php new file mode 100644 index 0000000..88187a0 --- /dev/null +++ b/src/Repository/PickupRepository.php @@ -0,0 +1,66 @@ + + * + * @method Pickup|null find($id, $lockMode = null, $lockVersion = null) + * @method Pickup|null findOneBy(array $criteria, array $orderBy = null) + * @method Pickup[] findAll() + * @method Pickup[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class PickupRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Pickup::class); + } + + public function save(Pickup $entity, bool $flush = false): void + { + $this->getEntityManager()->persist($entity); + + if ($flush) { + $this->getEntityManager()->flush(); + } + } + + public function remove(Pickup $entity, bool $flush = false): void + { + $this->getEntityManager()->remove($entity); + + if ($flush) { + $this->getEntityManager()->flush(); + } + } + +// /** +// * @return Pickup[] Returns an array of Pickup objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('p') +// ->andWhere('p.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('p.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?Pickup +// { +// return $this->createQueryBuilder('p') +// ->andWhere('p.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +} diff --git a/src/Repository/TrainingAttendanceRepository.php b/src/Repository/TrainingAttendanceRepository.php new file mode 100644 index 0000000..cc608a3 --- /dev/null +++ b/src/Repository/TrainingAttendanceRepository.php @@ -0,0 +1,66 @@ + + * + * @method TrainingAttendance|null find($id, $lockMode = null, $lockVersion = null) + * @method TrainingAttendance|null findOneBy(array $criteria, array $orderBy = null) + * @method TrainingAttendance[] findAll() + * @method TrainingAttendance[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class TrainingAttendanceRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, TrainingAttendance::class); + } + + public function save(TrainingAttendance $entity, bool $flush = false): void + { + $this->getEntityManager()->persist($entity); + + if ($flush) { + $this->getEntityManager()->flush(); + } + } + + public function remove(TrainingAttendance $entity, bool $flush = false): void + { + $this->getEntityManager()->remove($entity); + + if ($flush) { + $this->getEntityManager()->flush(); + } + } + +// /** +// * @return TrainingAttendance[] Returns an array of TrainingAttendance objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('t') +// ->andWhere('t.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('t.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?TrainingAttendance +// { +// return $this->createQueryBuilder('t') +// ->andWhere('t.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +} diff --git a/src/Repository/TrainingRepository.php b/src/Repository/TrainingRepository.php new file mode 100644 index 0000000..0b71986 --- /dev/null +++ b/src/Repository/TrainingRepository.php @@ -0,0 +1,66 @@ + + * + * @method Training|null find($id, $lockMode = null, $lockVersion = null) + * @method Training|null findOneBy(array $criteria, array $orderBy = null) + * @method Training[] findAll() + * @method Training[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class TrainingRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Training::class); + } + + public function save(Training $entity, bool $flush = false): void + { + $this->getEntityManager()->persist($entity); + + if ($flush) { + $this->getEntityManager()->flush(); + } + } + + public function remove(Training $entity, bool $flush = false): void + { + $this->getEntityManager()->remove($entity); + + if ($flush) { + $this->getEntityManager()->flush(); + } + } + +// /** +// * @return Training[] Returns an array of Training objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('t') +// ->andWhere('t.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('t.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?Training +// { +// return $this->createQueryBuilder('t') +// ->andWhere('t.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +} diff --git a/src/Repository/UploadRepository.php b/src/Repository/UploadRepository.php new file mode 100644 index 0000000..8aa6381 --- /dev/null +++ b/src/Repository/UploadRepository.php @@ -0,0 +1,66 @@ + + * + * @method Upload|null find($id, $lockMode = null, $lockVersion = null) + * @method Upload|null findOneBy(array $criteria, array $orderBy = null) + * @method Upload[] findAll() + * @method Upload[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class UploadRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Upload::class); + } + + public function save(Upload $entity, bool $flush = false): void + { + $this->getEntityManager()->persist($entity); + + if ($flush) { + $this->getEntityManager()->flush(); + } + } + + public function remove(Upload $entity, bool $flush = false): void + { + $this->getEntityManager()->remove($entity); + + if ($flush) { + $this->getEntityManager()->flush(); + } + } + +// /** +// * @return Upload[] Returns an array of Upload objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('u') +// ->andWhere('u.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('u.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?Upload +// { +// return $this->createQueryBuilder('u') +// ->andWhere('u.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +}