| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247 |
- <?php
- declare(strict_types=1);
- namespace App\Entity\AccessWish;
- use App\Entity\Access\Access;
- use App\Entity\Core\Country;
- use App\Entity\Core\File;
- use App\Entity\Core\Tagg;
- use App\Entity\Organization\Organization;
- //use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
- use Doctrine\Common\Collections\ArrayCollection;
- use Doctrine\ORM\Mapping as ORM;
- use Doctrine\Common\Collections\Collection;
- /**
- * Classe ... qui ...
- */
- //#[Auditable]
- #[ORM\Entity]
- class AccessWish
- {
- #[ORM\Id]
- #[ORM\Column]
- #[ORM\GeneratedValue]
- private ?int $id = null;
- #[ORM\ManyToOne]
- #[ORM\JoinColumn(nullable: false)]
- private Organization $organization;
- #[ORM\ManyToOne(cascade: ['persist'], inversedBy: 'accessWishes')]
- #[ORM\JoinColumn(onDelete: 'CASCADE')]
- private Access $accessOriginal;
- #[ORM\ManyToOne(inversedBy: 'accessWishes')]
- private AccessFamilyWish $accessFamilyWish;
- #[ORM\ManyToOne]
- #[ORM\JoinColumn(referencedColumnName: 'id', nullable: false, onDelete: 'SET NULL')]
- private File $image;
- #[ORM\ManyToOne]
- private Country $addressCountry;
- #[ORM\OneToMany(mappedBy: 'accessWish', targetEntity: EducationStudentWish::class, cascade: ['persist'], orphanRemoval: true)]
- private Collection $educationStudentWishes;
- #[ORM\OneToMany(mappedBy: 'accessWishReregistrations', targetEntity: EducationStudentWish::class, cascade: ['persist'], orphanRemoval: true)]
- private Collection $educationStudentReregistrationsWishes;
- #[ORM\OneToMany(mappedBy: 'accessWish', targetEntity: DocumentWish::class, cascade: ['persist'])]
- private Collection $documentWishes;
- #[ORM\ManyToMany(targetEntity: Tagg::class, inversedBy: 'accessWishes', cascade: ['persist'])]
- #[ORM\JoinTable(name: 'tag_accessWish')]
- #[ORM\JoinColumn(name: 'accessWish_id', referencedColumnName: 'id')]
- #[ORM\InverseJoinColumn(name: 'tag_id', referencedColumnName: 'id')]
- private Collection $tags;
- public function __construct()
- {
- $this->educationStudentWishes = new ArrayCollection();
- $this->educationStudentReregistrationsWishes = new ArrayCollection();
- $this->documentWishes = 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;
- }
- public function getAccessOriginal(): ?Access
- {
- return $this->accessOriginal;
- }
- public function setAccessOriginal(?Access $accessOriginal): self
- {
- $this->accessOriginal = $accessOriginal;
- return $this;
- }
- public function getAccessFamilyWish(): ?AccessFamilyWish
- {
- return $this->accessFamilyWish;
- }
- public function setAccessFamilyWish(?AccessFamilyWish $accessFamilyWish): self
- {
- $this->accessFamilyWish = $accessFamilyWish;
- return $this;
- }
- public function getImage(): ?File
- {
- return $this->image;
- }
- public function setImage(?File $image): self
- {
- $this->image = $image;
- return $this;
- }
- public function getAddressCountry(): ?Country
- {
- return $this->addressCountry;
- }
- public function setAddressCountry(?Country $addressCountry): self
- {
- $this->addressCountry = $addressCountry;
- return $this;
- }
- /**
- * @return Collection<int, EducationStudentWish>
- */
- public function getEducationStudentWishes(): Collection
- {
- return $this->educationStudentWishes;
- }
- public function addEducationStudentWish(EducationStudentWish $educationStudentWish): self
- {
- if (!$this->educationStudentWishes->contains($educationStudentWish)) {
- $this->educationStudentWishes[] = $educationStudentWish;
- $educationStudentWish->setAccessWish($this);
- }
- return $this;
- }
- public function removeEducationStudentWish(EducationStudentWish $educationStudentWish): self
- {
- if ($this->educationStudentWishes->removeElement($educationStudentWish)) {
- // set the owning side to null (unless already changed)
- if ($educationStudentWish->getAccessWish() === $this) {
- $educationStudentWish->setAccessWish(null);
- }
- }
- return $this;
- }
- /**
- * @return Collection<int, EducationStudentWish>
- */
- public function getEducationStudentReregistrationsWishes(): Collection
- {
- return $this->educationStudentReregistrationsWishes;
- }
- public function addEducationStudentReregistrationsWish(EducationStudentWish $educationStudentReregistrationsWish): self
- {
- if (!$this->educationStudentReregistrationsWishes->contains($educationStudentReregistrationsWish)) {
- $this->educationStudentReregistrationsWishes[] = $educationStudentReregistrationsWish;
- $educationStudentReregistrationsWish->setAccessWishReregistrations($this);
- }
- return $this;
- }
- public function removeEducationStudentReregistrationsWish(EducationStudentWish $educationStudentReregistrationsWish): self
- {
- if ($this->educationStudentReregistrationsWishes->removeElement($educationStudentReregistrationsWish)) {
- // set the owning side to null (unless already changed)
- if ($educationStudentReregistrationsWish->getAccessWishReregistrations() === $this) {
- $educationStudentReregistrationsWish->setAccessWishReregistrations(null);
- }
- }
- return $this;
- }
- /**
- * @return Collection<int, DocumentWish>
- */
- public function getDocumentWishes(): Collection
- {
- return $this->documentWishes;
- }
- public function addDocumentWish(DocumentWish $documentWish): self
- {
- if (!$this->documentWishes->contains($documentWish)) {
- $this->documentWishes[] = $documentWish;
- $documentWish->setAccessWish($this);
- }
- return $this;
- }
- public function removeDocumentWish(DocumentWish $documentWish): self
- {
- if ($this->documentWishes->removeElement($documentWish)) {
- // set the owning side to null (unless already changed)
- if ($documentWish->getAccessWish() === $this) {
- $documentWish->setAccessWish(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;
- }
- }
|