| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- <?php
- declare (strict_types=1);
- namespace App\Entity\Organization;
- use ApiPlatform\Metadata\Get;
- use ApiPlatform\Metadata\ApiResource;
- use App\Entity\Access\Access;
- use App\Entity\Booking\Examen;
- use App\Entity\Core\Tagg;
- //use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
- use Doctrine\Common\Collections\ArrayCollection;
- use Doctrine\Common\Collections\Collection;
- use Doctrine\ORM\Mapping as ORM;
- /**
- * Classe ... qui ...
- */
- #[ApiResource(operations: [])]
- //#[Auditable]
- #[ORM\Entity]
- class Jury
- {
- #[ORM\Id]
- #[ORM\Column]
- #[ORM\GeneratedValue]
- private ?int $id = null;
- #[ORM\ManyToOne(inversedBy: 'juries')]
- #[ORM\JoinColumn(nullable: false)]
- private Organization $organization;
- #[ORM\ManyToMany(targetEntity: Access::class, inversedBy: 'juryMembers', cascade: ['persist'])]
- #[ORM\JoinTable(name: 'juries_members')]
- private Collection $members;
- #[ORM\OneToMany(mappedBy: 'jury', targetEntity: Examen::class)]
- private Collection $examens;
- #[ORM\ManyToMany(targetEntity: Tagg::class, inversedBy: 'juries', cascade: ['persist'])]
- #[ORM\JoinTable(name: 'tag_jury')]
- #[ORM\JoinColumn(name: 'jury_id', referencedColumnName: 'id')]
- #[ORM\InverseJoinColumn(name: 'tag_id', referencedColumnName: 'id')]
- private Collection $tags;
- public function __construct()
- {
- $this->members = new ArrayCollection();
- $this->examens = new ArrayCollection();
- $this->tags = new ArrayCollection();
- }
- public function getId(): ?int
- {
- return $this->id;
- }
- public function getOrganization(): ?Organization
- {
- return $this->organization;
- }
- public function setOrganization(?Organization $organization): self
- {
- $this->organization = $organization;
- return $this;
- }
- /**
- * @return Collection<int, Access>
- */
- public function getMembers(): Collection
- {
- return $this->members;
- }
- public function addMember(Access $member): self
- {
- if (!$this->members->contains($member)) {
- $this->members[] = $member;
- }
- return $this;
- }
- public function removeMember(Access $member): self
- {
- $this->members->removeElement($member);
- return $this;
- }
- /**
- * @return Collection<int, Examen>
- */
- public function getExamens(): Collection
- {
- return $this->examens;
- }
- public function addExamen(Examen $examen): self
- {
- if (!$this->examens->contains($examen)) {
- $this->examens[] = $examen;
- $examen->setJury($this);
- }
- return $this;
- }
- public function removeExamen(Examen $examen): self
- {
- if ($this->examens->removeElement($examen)) {
- // set the owning side to null (unless already changed)
- if ($examen->getJury() === $this) {
- $examen->setJury(null);
- }
- }
- return $this;
- }
- /**
- * @return Collection<int, Tagg>
- */
- public function getTags(): Collection
- {
- return $this->tags;
- }
- public function addTag(Tagg $tag): self
- {
- if (!$this->tags->contains($tag)) {
- $this->tags[] = $tag;
- }
- return $this;
- }
- public function removeTag(Tagg $tag): self
- {
- $this->tags->removeElement($tag);
- return $this;
- }
- }
|