WIP: Implement model

This commit is contained in:
Björn Fromme
2023-09-12 18:17:24 +02:00
parent 35ca61d21b
commit f8c9ff82a5
35 changed files with 2935 additions and 0 deletions
+4
View File
@@ -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' }
+99
View File
@@ -0,0 +1,99 @@
<?php
namespace App\Entity;
use App\Entity\Traits\TimestampableEntity;
use App\Repository\ApplicationRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ApplicationRepository::class)]
class Application implements TimestampableEntityInterface
{
use TimestampableEntity;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\ManyToOne(inversedBy: 'applications')]
private ?Assignment $assignment = null;
#[ORM\ManyToOne(inversedBy: 'applications')]
private ?Teamer $teamer = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $requests = null;
#[ORM\Column(length: 64)]
private ?string $status = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $remarks = null;
public function getId(): ?int
{
return $this->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;
}
}
+305
View File
@@ -0,0 +1,305 @@
<?php
namespace App\Entity;
use App\Entity\Traits\BlameableEntity;
use App\Entity\Traits\TimestampableEntity;
use App\Repository\AssignmentRepository;
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;
#[ORM\Entity(repositoryClass: AssignmentRepository::class)]
class Assignment implements BlameableEntityInterface, TimestampableEntityInterface
{
use BlameableEntity;
use TimestampableEntity;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(type: 'string', length: 36, unique: true)]
private string $uuid;
#[ORM\Column(length: 64)]
private ?string $busProCode = null;
#[ORM\Column]
private ?int $available = null;
#[ORM\Column(type: Types::DATE_IMMUTABLE)]
private ?\DateTimeImmutable $dateFrom = null;
#[ORM\Column(type: Types::DATE_IMMUTABLE)]
private ?\DateTimeImmutable $dateTo = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $benefits = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $remarks = null;
#[ORM\ManyToOne]
private ?User $owner = null;
#[ORM\ManyToMany(targetEntity: Pickup::class)]
private Collection $pickups;
#[ORM\ManyToMany(targetEntity: Fee::class)]
private Collection $fees;
#[ORM\OneToMany(mappedBy: 'assignment', targetEntity: Application::class)]
private Collection $applications;
#[ORM\OneToMany(mappedBy: 'assignment', targetEntity: Disposition::class)]
private Collection $dispositions;
#[ORM\OneToMany(mappedBy: 'assignment', targetEntity: DispositionRequirement::class)]
private Collection $requirements;
public function __construct()
{
$this->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<int, Pickup>
*/
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<int, Fee>
*/
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<int, Application>
*/
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<int, Disposition>
*/
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<int, DispositionRequirement>
*/
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;
}
}
+71
View File
@@ -0,0 +1,71 @@
<?php
namespace App\Entity;
use App\Entity\Traits\BlameableEntity;
use App\Entity\Traits\TimestampableEntity;
use App\Repository\AvailabilityRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: AvailabilityRepository::class)]
class Availability implements BlameableEntityInterface, TimestampableEntityInterface
{
use BlameableEntity;
use TimestampableEntity;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(type: Types::DATE_IMMUTABLE)]
private ?\DateTimeImmutable $dateFrom = null;
#[ORM\Column(type: Types::DATE_IMMUTABLE)]
private ?\DateTimeImmutable $dateTo = null;
#[ORM\ManyToOne(inversedBy: 'availabilities')]
private ?Teamer $owner = null;
public function getId(): ?int
{
return $this->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;
}
}
+14
View File
@@ -0,0 +1,14 @@
<?php
namespace App\Entity;
interface BlameableEntityInterface
{
public function getCreatedBy();
public function setCreatedBy(string $createdBy);
public function getUpdatedBy();
public function setUpdatedBy(string $updatedBy);
}
+85
View File
@@ -0,0 +1,85 @@
<?php
namespace App\Entity;
use App\Entity\Traits\BlameableEntity;
use App\Entity\Traits\TimestampableEntity;
use App\Repository\DispositionRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Uid\Uuid;
#[ORM\Entity(repositoryClass: DispositionRepository::class)]
class Disposition implements BlameableEntityInterface, TimestampableEntityInterface
{
use BlameableEntity;
use TimestampableEntity;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(type: 'string', length: 36, unique: true)]
private string $uuid;
#[ORM\ManyToOne(inversedBy: 'dispositions')]
private ?Assignment $assignment = null;
#[ORM\ManyToOne(inversedBy: 'dispositions')]
private ?Teamer $teamer = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $remarks = null;
public function __construct()
{
$this->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;
}
}
+81
View File
@@ -0,0 +1,81 @@
<?php
namespace App\Entity;
use App\Repository\DispositionRequirementRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: DispositionRequirementRepository::class)]
class DispositionRequirement
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\ManyToOne]
private ?Training $training = null;
#[ORM\ManyToOne]
private ?Pickup $pickup = null;
#[ORM\Column(type: Types::DATE_IMMUTABLE, nullable: true)]
private ?\DateTimeImmutable $pickupDate = null;
#[ORM\ManyToOne(inversedBy: 'requirements')]
private ?Assignment $assignment = null;
public function getId(): ?int
{
return $this->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;
}
}
+71
View File
@@ -0,0 +1,71 @@
<?php
namespace App\Entity;
use App\Entity\Traits\BlameableEntity;
use App\Entity\Traits\TimestampableEntity;
use App\Repository\FaqRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: FaqRepository::class)]
class Faq implements BlameableEntityInterface, TimestampableEntityInterface
{
use BlameableEntity;
use TimestampableEntity;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(type: Types::TEXT)]
private ?string $question = null;
#[ORM\Column(type: Types::TEXT)]
private ?string $answer = null;
#[ORM\Column]
private ?int $sorting = null;
public function getId(): ?int
{
return $this->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;
}
}
+55
View File
@@ -0,0 +1,55 @@
<?php
namespace App\Entity;
use App\Entity\Traits\BlameableEntity;
use App\Entity\Traits\TimestampableEntity;
use App\Repository\FeeRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: FeeRepository::class)]
class Fee implements BlameableEntityInterface, TimestampableEntityInterface
{
use BlameableEntity;
use TimestampableEntity;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column]
private ?int $value = null;
#[ORM\Column(length: 255)]
private ?string $name = null;
public function getId(): ?int
{
return $this->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;
}
}
+130
View File
@@ -0,0 +1,130 @@
<?php
namespace App\Entity;
use App\Entity\Traits\BlameableEntity;
use App\Entity\Traits\TimestampableEntity;
use App\Repository\FeedbackRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Uid\Uuid;
#[ORM\Entity(repositoryClass: FeedbackRepository::class)]
class Feedback implements BlameableEntityInterface, TimestampableEntityInterface
{
use BlameableEntity;
use TimestampableEntity;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(type: 'string', length: 36, unique: true)]
private string $uuid;
#[ORM\ManyToOne(inversedBy: 'feedback')]
private ?Teamer $teamer = null;
#[ORM\Column(type: Types::TEXT)]
private ?string $body = null;
#[ORM\Column(length: 255)]
private ?string $assignmentDestination = null;
#[ORM\Column(type: Types::DATE_IMMUTABLE)]
private ?\DateTimeImmutable $assignmentDate = null;
#[ORM\Column(length: 255)]
private ?string $authorName = null;
#[ORM\Column(length: 255)]
private ?string $authorEmail = null;
public function __construct()
{
$this->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;
}
}
+85
View File
@@ -0,0 +1,85 @@
<?php
namespace App\Entity;
use App\Entity\Traits\BlameableEntity;
use App\Entity\Traits\TimestampableEntity;
use App\Repository\JobProfileRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Uid\Uuid;
#[ORM\Entity(repositoryClass: JobProfileRepository::class)]
class JobProfile implements BlameableEntityInterface, TimestampableEntityInterface
{
use BlameableEntity;
use TimestampableEntity;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(type: 'string', length: 36, unique: true)]
private string $uuid;
#[ORM\Column(length: 255)]
private ?string $name = null;
#[ORM\ManyToOne]
private ?Training $requiredTraining = null;
#[ORM\Column(type: Types::JSON)]
private array $requiredLicenses = [];
public function __construct()
{
$this->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;
}
}
+102
View File
@@ -0,0 +1,102 @@
<?php
namespace App\Entity;
use App\Entity\Traits\TimestampableEntity;
use App\Repository\LicenseRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Uid\Uuid;
#[ORM\Entity(repositoryClass: LicenseRepository::class)]
class License implements TimestampableEntityInterface
{
use TimestampableEntity;
public const TYPE_SKI = 'ski';
public const TYPE_SNOWBOARD = 'snowboard';
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(type: 'string', length: 36, unique: true)]
private string $uuid;
#[ORM\Column(length: 64)]
private ?string $type = null;
#[ORM\Column(type: Types::DATE_IMMUTABLE)]
private ?\DateTimeImmutable $date = null;
#[ORM\OneToOne(cascade: ['persist', 'remove'])]
private ?Upload $certificate = null;
#[ORM\ManyToOne(inversedBy: 'licenses')]
private ?Teamer $teamer = null;
public function __construct()
{
$this->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;
}
}
+56
View File
@@ -0,0 +1,56 @@
<?php
namespace App\Entity;
use App\Entity\Traits\BlameableEntity;
use App\Entity\Traits\TimestampableEntity;
use App\Repository\PeriodRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: PeriodRepository::class)]
class Period implements BlameableEntityInterface, TimestampableEntityInterface
{
use BlameableEntity;
use TimestampableEntity;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(type: Types::DATE_IMMUTABLE)]
private ?\DateTimeImmutable $dateFrom = null;
#[ORM\Column(type: Types::DATE_IMMUTABLE)]
private ?\DateTimeImmutable $dateTo = null;
public function getId(): ?int
{
return $this->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;
}
}
+50
View File
@@ -0,0 +1,50 @@
<?php
namespace App\Entity;
use App\Repository\PickupRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: PickupRepository::class)]
class Pickup
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $name = null;
#[ORM\Column]
private ?int $busProId = null;
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;
}
public function getBusProId(): ?int
{
return $this->busProId;
}
public function setBusProId(int $busProId): static
{
$this->busProId = $busProId;
return $this;
}
}
+288
View File
@@ -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<int, Availability>
*/
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<int, Feedback>
*/
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<int, TrainingAttendance>
*/
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<int, License>
*/
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<int, JobProfile>
*/
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<int, Assignment>
*/
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<int, Application>
*/
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<int, Disposition>
*/
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;
}
}
+80
View File
@@ -0,0 +1,80 @@
<?php
namespace App\Entity;
use App\Entity\Traits\BlameableEntity;
use App\Entity\Traits\TimestampableEntity;
use App\Repository\TrainingRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: TrainingRepository::class)]
class Training implements BlameableEntityInterface, TimestampableEntityInterface
{
use BlameableEntity;
use TimestampableEntity;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $name = null;
#[ORM\OneToMany(mappedBy: 'training', targetEntity: TrainingAttendance::class)]
private Collection $trainingAttendances;
public function __construct()
{
$this->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<int, TrainingAttendance>
*/
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;
}
}
+98
View File
@@ -0,0 +1,98 @@
<?php
namespace App\Entity;
use App\Entity\Traits\TimestampableEntity;
use App\Repository\TrainingAttendanceRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Uid\Uuid;
#[ORM\Entity(repositoryClass: TrainingAttendanceRepository::class)]
class TrainingAttendance implements TimestampableEntityInterface
{
use TimestampableEntity;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(type: 'string', length: 36, unique: true)]
private string $uuid;
#[ORM\ManyToOne(inversedBy: 'trainingAttendances')]
private ?Training $training = null;
#[ORM\Column(type: Types::DATE_IMMUTABLE)]
private ?\DateTimeImmutable $date = null;
#[ORM\OneToOne(cascade: ['persist', 'remove'])]
private ?Upload $certificate = null;
#[ORM\ManyToOne(inversedBy: 'trainingAttendances')]
private ?Teamer $teamer = null;
public function __construct()
{
$this->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;
}
}
+38
View File
@@ -0,0 +1,38 @@
<?php
namespace App\Entity\Traits;
use Doctrine\ORM\Mapping as ORM;
trait BlameableEntity
{
#[ORM\Column(nullable: true)]
private ?string $createdBy = null;
#[ORM\Column(nullable: true)]
private ?string $updatedBy = null;
public function getCreatedBy(): ?string
{
return $this->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;
}
}
+148
View File
@@ -0,0 +1,148 @@
<?php
namespace App\Entity;
use App\Entity\Traits\BlameableEntity;
use App\Entity\Traits\TimestampableEntity;
use App\Repository\UploadRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Uid\Uuid;
#[ORM\Entity(repositoryClass: UploadRepository::class)]
class Upload implements BlameableEntityInterface, TimestampableEntityInterface
{
use BlameableEntity;
use TimestampableEntity;
public const STATUS_NEW = 'new';
public const STATUS_IN_PROCESS = 'in_process';
public const STATUS_CHECKED = 'checked';
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(type: 'string', length: 36, unique: true)]
private string $uuid;
#[ORM\Column(length: 64)]
private ?string $type = null;
#[ORM\Column(length: 64, nullable: true)]
private ?string $status = null;
#[ORM\Column(length: 255)]
private ?string $filename = null;
#[ORM\Column(length: 255)]
private ?string $originalFilename = null;
#[ORM\Column]
private ?int $size = null;
#[ORM\Column(length: 255)]
private ?string $mimeType = null;
#[ORM\ManyToOne]
private ?User $owner = null;
public function __construct()
{
$this->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;
}
}
@@ -0,0 +1,85 @@
<?php
namespace App\EventListener;
use App\Entity\BlameableEntityInterface;
use Doctrine\Common\EventSubscriber;
use Doctrine\ORM\Event\PrePersistEventArgs;
use Doctrine\ORM\Event\PreUpdateEventArgs;
use Doctrine\ORM\Events;
use Symfony\Bundle\SecurityBundle\Security;
use Symfony\Component\Security\Core\User\UserInterface;
class BlamableEntitySubscriber implements EventSubscriber
{
/**
* Properties that are ignored when determining
* changesets.
*
* @var string[]
*/
protected static array $ignoredProperties = [
'updatedAt',
'updatedBy',
];
public function __construct(private readonly Security $security)
{}
public function getSubscribedEvents(): array
{
return [
Events::prePersist,
Events::preUpdate,
];
}
public function prePersist(PrePersistEventArgs $args): void
{
$entity = $args->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;
}
}
+66
View File
@@ -0,0 +1,66 @@
<?php
namespace App\Repository;
use App\Entity\Application;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<Application>
*
* @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()
// ;
// }
}
+66
View File
@@ -0,0 +1,66 @@
<?php
namespace App\Repository;
use App\Entity\Assignment;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<Assignment>
*
* @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()
// ;
// }
}
+66
View File
@@ -0,0 +1,66 @@
<?php
namespace App\Repository;
use App\Entity\Availability;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<Availability>
*
* @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()
// ;
// }
}
+66
View File
@@ -0,0 +1,66 @@
<?php
namespace App\Repository;
use App\Entity\Disposition;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<Disposition>
*
* @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()
// ;
// }
}
@@ -0,0 +1,66 @@
<?php
namespace App\Repository;
use App\Entity\DispositionRequirement;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<DispositionRequirement>
*
* @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()
// ;
// }
}
+66
View File
@@ -0,0 +1,66 @@
<?php
namespace App\Repository;
use App\Entity\Faq;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<Faq>
*
* @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()
// ;
// }
}
+66
View File
@@ -0,0 +1,66 @@
<?php
namespace App\Repository;
use App\Entity\Fee;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<Fee>
*
* @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()
// ;
// }
}
+66
View File
@@ -0,0 +1,66 @@
<?php
namespace App\Repository;
use App\Entity\Feedback;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<Feedback>
*
* @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()
// ;
// }
}
+66
View File
@@ -0,0 +1,66 @@
<?php
namespace App\Repository;
use App\Entity\JobProfile;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<JobProfile>
*
* @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()
// ;
// }
}
+66
View File
@@ -0,0 +1,66 @@
<?php
namespace App\Repository;
use App\Entity\License;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<License>
*
* @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()
// ;
// }
}
+66
View File
@@ -0,0 +1,66 @@
<?php
namespace App\Repository;
use App\Entity\Period;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<Period>
*
* @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()
// ;
// }
}
+66
View File
@@ -0,0 +1,66 @@
<?php
namespace App\Repository;
use App\Entity\Pickup;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<Pickup>
*
* @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()
// ;
// }
}
@@ -0,0 +1,66 @@
<?php
namespace App\Repository;
use App\Entity\TrainingAttendance;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<TrainingAttendance>
*
* @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()
// ;
// }
}
+66
View File
@@ -0,0 +1,66 @@
<?php
namespace App\Repository;
use App\Entity\Training;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<Training>
*
* @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()
// ;
// }
}
+66
View File
@@ -0,0 +1,66 @@
<?php
namespace App\Repository;
use App\Entity\Upload;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<Upload>
*
* @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()
// ;
// }
}