src/Entity/AbstractAuthors.php line 12

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\AbstractAuthorsRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassAbstractAuthorsRepository::class)]
  9. class AbstractAuthors
  10. {
  11.     const RESIDENT 0;
  12.     const SPECIALISTE 1;
  13.     const ASSISTANT 2;
  14.     const PROF 3;
  15.     const PROFAGREGE 4;
  16.     #[ORM\Id]
  17.     #[ORM\GeneratedValue]
  18.     #[ORM\Column]
  19.     private ?int $id null;
  20.     #[ORM\Column(length255nullabletrue)]
  21.     private ?string $firstName null;
  22.     #[ORM\Column(length255nullabletrue)]
  23.     private ?string $lastName null;
  24.     #[ORM\Column(length255nullabletrue)]
  25.     private ?string $service null;
  26.     #[ORM\Column(typeTypes::SMALLINTnullabletrue)]
  27.     private ?int $title null;
  28.     #[ORM\Column(typeTypes::SMALLINTnullabletrue)]
  29.     private ?int $isResponsible null;
  30.     #[ORM\Column(typeTypes::SMALLINTnullabletrue)]
  31.     private ?int $isPresenter null;
  32.     #[ORM\OneToMany(targetEntityEventAbstract::class, mappedBy'responsable')]
  33.     private Collection $eventAbstractAsResponsable;
  34.     #[ORM\ManyToMany(targetEntityEventAbstract::class, mappedBy'presenters')]
  35.     private Collection $eventAbstractsAsPresenter;
  36.     # [ORM\ManyToMany(targetEntity: EventAbstract::class, mappedBy: 'authors')]
  37.     private Collection $eventAbstractsAsAuthors;
  38.     #[ORM\ManyToOne]
  39.     private ?EventAbstract $abstract null;
  40.     public function __construct()
  41.     {
  42.         $this->eventAbstractAsResponsable = new ArrayCollection();
  43.         $this->eventAbstractsAsPresenter = new ArrayCollection();
  44.         $this->eventAbstractsAsAuthors = new ArrayCollection();
  45.     }
  46.     public function getId(): ?int
  47.     {
  48.         return $this->id;
  49.     }
  50.     public function getFirstName(): ?string
  51.     {
  52.         return $this->firstName;
  53.     }
  54.     public function setFirstName(?string $firstName): static
  55.     {
  56.         $this->firstName $firstName;
  57.         return $this;
  58.     }
  59.     public function getService(): ?string
  60.     {
  61.         return $this->service;
  62.     }
  63.     public function setService(?string $service): static
  64.     {
  65.         $this->service $service;
  66.         return $this;
  67.     }
  68.     public function getTitle(): ?int
  69.     {
  70.         return $this->title;
  71.     }
  72.     public function setTitle(?int $title): static
  73.     {
  74.         $this->title $title;
  75.         return $this;
  76.     }
  77.     public function getIsResponsible(): ?int
  78.     {
  79.         return $this->isResponsible;
  80.     }
  81.     public function setIsResponsible(?int $isResponsible): static
  82.     {
  83.         $this->isResponsible $isResponsible;
  84.         return $this;
  85.     }
  86.     public function getIsPresenter(): ?int
  87.     {
  88.         return $this->isPresenter;
  89.     }
  90.     public function setIsPresenter(?int $isPresenter): static
  91.     {
  92.         $this->isPresenter $isPresenter;
  93.         return $this;
  94.     }
  95.     /**
  96.      * cette fonction retourne les abstratcs où l'auteur est responsable d'abstract
  97.      * @return Collection<int, EventAbstract>
  98.      */
  99.     public function getEventAbstractAsResponsable(): Collection
  100.     {
  101.         return $this->eventAbstractAsResponsable;
  102.     }
  103.     /**
  104.      * cette fonction ajoute un abstract à la liste des abstracts où l'auteur est responsable
  105.      * @param EventAbstract $eventAbstract
  106.      * @return self
  107.      */
  108.     public function addEventAbstractAsResponsable(EventAbstract $eventAbstract): static
  109.     {
  110.         if (!$this->eventAbstractAsResponsable->contains($eventAbstract)) {
  111.             $this->eventAbstractAsResponsable->add($eventAbstract);
  112.             $eventAbstract->setResponsable($this);
  113.         }
  114.         return $this;
  115.     }
  116.     /**
  117.      * cette fonction enlève un abstract de la liste des abstracts où l'auteur est responsable
  118.      * @param EventAbstract $eventAbstract
  119.      * @return self
  120.      */
  121.     public function removeEventAbstractAsResponsable(EventAbstract $eventAbstract): static
  122.     {
  123.         if ($this->eventAbstractAsResponsable->removeElement($eventAbstract)) {
  124.             // set the owning side to null (unless already changed)
  125.             if ($eventAbstract->getResponsable() === $this) {
  126.                 $eventAbstract->setResponsable(null);
  127.             }
  128.         }
  129.         return $this;
  130.     }
  131.     /**
  132.      * Cette fonction retourne les abstracts où l'auteur a été présentateur
  133.      * @return Collection<int, EventAbstract>
  134.      */
  135.     public function getEventAbstractsAsPresenter(): Collection
  136.     {
  137.         return $this->eventAbstractsAsPresenter;
  138.     }
  139.     /**
  140.      * cette fonction ajoute un abstract à la liste des abstracts où l'auteur est présnateur
  141.      * @param EventAbstract $eventAbstract
  142.      * @return self
  143.      */
  144.     public function addEventAbstractAsPresenter(EventAbstract $eventAbstract): static
  145.     {
  146.         if (!$this->eventAbstractsAsPresenter->contains($eventAbstract)) {
  147.             $this->eventAbstractsAsPresenter->add($eventAbstract);
  148.             $eventAbstract->addPresenter($this);
  149.         }
  150.         return $this;
  151.     }
  152.     /**
  153.      * cette fonction ajoute un abstract à la liste des abstracts où l'auteur est présentateur
  154.      * @param EventAbstract $eventAbstract
  155.      * @return self
  156.      */
  157.     public function removeEventAbstractAsPresenter(EventAbstract $eventAbstract): static
  158.     {
  159.         if ($this->eventAbstractsAsPresenter->removeElement($eventAbstract)) {
  160.             if ($eventAbstract->getPresenters()->contains($this)) {
  161.                 $eventAbstract->removePresenter($this);
  162.             }
  163.         }
  164.         return $this;
  165.     }
  166.     public function getLastName(): ?string
  167.     {
  168.         return $this->lastName;
  169.     }
  170.     public function setLastName(?string $lastName): static
  171.     {
  172.         $this->lastName $lastName;
  173.         return $this;
  174.     }
  175.     public function getAbstract(): ?EventAbstract
  176.     {
  177.         return $this->abstract;
  178.     }
  179.     public function setAbstract(?EventAbstract $abstract): static
  180.     {
  181.         $this->abstract $abstract;
  182.         return $this;
  183.     }
  184.     /**
  185.      * Get the value of eventAbstractsAuthors
  186.      */
  187.     public function getEventAbstractsAsAuthors()
  188.     {
  189.         return $this->eventAbstractsAsAuthors;
  190.     }
  191.     /**
  192.      * Set the value of eventAbstractsAuthors
  193.      *
  194.      * @return  self
  195.      */
  196.     public function setEventAbstractsAsAuthors($eventAbstractsAsAuthors)
  197.     {
  198.         $this->eventAbstractsAsAuthors $eventAbstractsAsAuthors;
  199.         return $this;
  200.     }
  201.     /**
  202.      * cette fonction ajoute un abstract à la liste des abstracts où l'auteur est présnateur
  203.      * @param EventAbstract $eventAbstract
  204.      * @return self
  205.      */
  206.     public function addEventAbstractsAuthor(EventAbstract $eventAbstract): static
  207.     {
  208.         if (!$this->eventAbstractsAsAuthors->contains($eventAbstract)) {
  209.             $this->eventAbstractsAsAuthors->add($eventAbstract);
  210.             $eventAbstract->addAuthor($this);
  211.         }
  212.         return $this;
  213.     }
  214.     /**
  215.      * cette fonction ajoute un abstract à la liste des abstracts où l'auteur est présentateur
  216.      * @param EventAbstract $eventAbstract
  217.      * @return self
  218.      */
  219.     public function removeEventAbstractsAuthor(EventAbstract $eventAbstract): static
  220.     {
  221.         if ($this->eventAbstractsAsAuthors->removeElement($eventAbstract)) {
  222.             if ($eventAbstract->getAuthors()->contains($this)) {
  223.                 $eventAbstract->removeAuthor($this);
  224.             }
  225.         }
  226.         return $this;
  227.     }
  228. }