src/Entity/Citation.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CitationRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassCitationRepository::class)]
  8. class Citation implements \Stringable
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private int $id;
  14.     #[ORM\Column(type'text'nullabletrue)]
  15.     private ?string $citation"";
  16.     #[ORM\ManyToOne(targetEntityContact::class, inversedBy'citations')]
  17.     private mixed $elu;
  18.     #[ORM\Column(type'boolean'nullabletrue)]
  19.     private ?bool $active;
  20.     #[ORM\ManyToMany(targetEntityPageAccueil::class, mappedBy'citations')]
  21.     private mixed $pageAccueils;
  22.     public function __construct()
  23.     {
  24.         $this->pageAccueils = new ArrayCollection();
  25.     }
  26.     public function getId(): ?int
  27.     {
  28.         return $this->id;
  29.     }
  30.     public function getCitation(): ?string
  31.     {
  32.         return $this->citation;
  33.     }
  34.     public function setCitation(?string $citation): self
  35.     {
  36.         $this->citation $citation;
  37.         return $this;
  38.     }
  39.     public function getElu(): ?Contact
  40.     {
  41.         return $this->elu;
  42.     }
  43.     public function setElu(?Contact $elu): self
  44.     {
  45.         $this->elu $elu;
  46.         return $this;
  47.     }
  48.     public function getActive(): ?bool
  49.     {
  50.         return $this->active;
  51.     }
  52.     public function setActive(?bool $active): self
  53.     {
  54.         $this->active $active;
  55.         return $this;
  56.     }
  57.     /**
  58.      * @return Collection|PageAccueil[]
  59.      */
  60.     public function getPageAccueils(): Collection
  61.     {
  62.         return $this->pageAccueils;
  63.     }
  64.     public function addPageAccueil(PageAccueil $pageAccueil): self
  65.     {
  66.         if (!$this->pageAccueils->contains($pageAccueil)) {
  67.             $this->pageAccueils[] = $pageAccueil;
  68.             $pageAccueil->addCitation($this);
  69.         }
  70.         return $this;
  71.     }
  72.     public function removePageAccueil(PageAccueil $pageAccueil): self
  73.     {
  74.         if ($this->pageAccueils->removeElement($pageAccueil)) {
  75.             $pageAccueil->removeCitation($this);
  76.         }
  77.         return $this;
  78.     }
  79.     public function __toString(): string
  80.     {
  81.         return (string) $this->citation;
  82.     }
  83. }