src/Entity/Lang.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\LangRepository;
  4. use App\Traits\CommonTrt;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9.  * @ORM\Entity(repositoryClass=LangRepository::class)
  10.  */
  11. class Lang
  12. {
  13.     use CommonTrt;
  14.     /**
  15.      * @ORM\Id
  16.      * @ORM\GeneratedValue
  17.      * @ORM\Column(type="integer")
  18.      */
  19.     private $id;
  20.     /**
  21.      * @ORM\Column(type="string", length=255)
  22.      */
  23.     private $name;
  24.     /**
  25.      * @ORM\Column(type="string", length=255)
  26.      */
  27.     private $slug;
  28.     /**
  29.      * @ORM\OneToMany(targetEntity=Header::class, mappedBy="langue")
  30.      */
  31.     private $headers;
  32.     /**
  33.      * @ORM\OneToMany(targetEntity=About::class, mappedBy="langue")
  34.      */
  35.     private $abouts;
  36.     /**
  37.      * @ORM\OneToMany(targetEntity=Titles::class, mappedBy="langue")
  38.      */
  39.     private $titles;
  40.     /**
  41.      * @ORM\OneToMany(targetEntity=News::class, mappedBy="langue")
  42.      */
  43.     private $news;
  44.     /**
  45.      * @ORM\OneToMany(targetEntity=Faqs::class, mappedBy="langue")
  46.      */
  47.     private $faqs;
  48.     /**
  49.      * @ORM\OneToMany(targetEntity=Activities::class, mappedBy="langue")
  50.      */
  51.     private $activities;
  52.     public function __construct()
  53.     {
  54.         $this->headers = new ArrayCollection();
  55.         $this->abouts = new ArrayCollection();
  56.         $this->titles = new ArrayCollection();
  57.         $this->news = new ArrayCollection();
  58.         $this->faqs = new ArrayCollection();
  59.         $this->activities = new ArrayCollection();
  60.     }
  61.     public function getId(): ?int
  62.     {
  63.         return $this->id;
  64.     }
  65.     public function getName(): ?string
  66.     {
  67.         return $this->name;
  68.     }
  69.     public function setName(string $name): self
  70.     {
  71.         $this->name = $name;
  72.         return $this;
  73.     }
  74.     public function getSlug(): ?string
  75.     {
  76.         return $this->slug;
  77.     }
  78.     public function setSlug(string $slug): self
  79.     {
  80.         $this->slug = $slug;
  81.         return $this;
  82.     }
  83.     /**
  84.      * @return Collection<int, Header>
  85.      */
  86.     public function getHeaders(): Collection
  87.     {
  88.         return $this->headers;
  89.     }
  90.     public function addHeader(Header $header): self
  91.     {
  92.         if (!$this->headers->contains($header)) {
  93.             $this->headers[] = $header;
  94.             $header->setLangue($this);
  95.         }
  96.         return $this;
  97.     }
  98.     public function removeHeader(Header $header): self
  99.     {
  100.         if ($this->headers->removeElement($header)) {
  101.             // set the owning side to null (unless already changed)
  102.             if ($header->getLangue() === $this) {
  103.                 $header->setLangue(null);
  104.             }
  105.         }
  106.         return $this;
  107.     }
  108.     /**
  109.      * @return Collection<int, About>
  110.      */
  111.     public function getAbouts(): Collection
  112.     {
  113.         return $this->abouts;
  114.     }
  115.     public function addAbout(About $about): self
  116.     {
  117.         if (!$this->abouts->contains($about)) {
  118.             $this->abouts[] = $about;
  119.             $about->setLangue($this);
  120.         }
  121.         return $this;
  122.     }
  123.     public function removeAbout(About $about): self
  124.     {
  125.         if ($this->abouts->removeElement($about)) {
  126.             // set the owning side to null (unless already changed)
  127.             if ($about->getLangue() === $this) {
  128.                 $about->setLangue(null);
  129.             }
  130.         }
  131.         return $this;
  132.     }
  133.     /**
  134.      * @return Collection<int, Titles>
  135.      */
  136.     public function getTitles(): Collection
  137.     {
  138.         return $this->titles;
  139.     }
  140.     public function addTitle(Titles $title): self
  141.     {
  142.         if (!$this->titles->contains($title)) {
  143.             $this->titles[] = $title;
  144.             $title->setLangue($this);
  145.         }
  146.         return $this;
  147.     }
  148.     public function removeTitle(Titles $title): self
  149.     {
  150.         if ($this->titles->removeElement($title)) {
  151.             // set the owning side to null (unless already changed)
  152.             if ($title->getLangue() === $this) {
  153.                 $title->setLangue(null);
  154.             }
  155.         }
  156.         return $this;
  157.     }
  158.     /**
  159.      * @return Collection<int, News>
  160.      */
  161.     public function getNews(): Collection
  162.     {
  163.         return $this->news;
  164.     }
  165.     public function addNews(News $news): self
  166.     {
  167.         if (!$this->news->contains($news)) {
  168.             $this->news[] = $news;
  169.             $news->setLangue($this);
  170.         }
  171.         return $this;
  172.     }
  173.     public function removeNews(News $news): self
  174.     {
  175.         if ($this->news->removeElement($news)) {
  176.             // set the owning side to null (unless already changed)
  177.             if ($news->getLangue() === $this) {
  178.                 $news->setLangue(null);
  179.             }
  180.         }
  181.         return $this;
  182.     }
  183.     /**
  184.      * @return Collection<int, Faqs>
  185.      */
  186.     public function getFaqs(): Collection
  187.     {
  188.         return $this->faqs;
  189.     }
  190.     public function addFaq(Faqs $faq): self
  191.     {
  192.         if (!$this->faqs->contains($faq)) {
  193.             $this->faqs[] = $faq;
  194.             $faq->setLangue($this);
  195.         }
  196.         return $this;
  197.     }
  198.     public function removeFaq(Faqs $faq): self
  199.     {
  200.         if ($this->faqs->removeElement($faq)) {
  201.             // set the owning side to null (unless already changed)
  202.             if ($faq->getLangue() === $this) {
  203.                 $faq->setLangue(null);
  204.             }
  205.         }
  206.         return $this;
  207.     }
  208.     /**
  209.      * @return Collection<int, Activities>
  210.      */
  211.     public function getActivities(): Collection
  212.     {
  213.         return $this->activities;
  214.     }
  215.     public function addActivity(Activities $activity): self
  216.     {
  217.         if (!$this->activities->contains($activity)) {
  218.             $this->activities[] = $activity;
  219.             $activity->setLangue($this);
  220.         }
  221.         return $this;
  222.     }
  223.     public function removeActivity(Activities $activity): self
  224.     {
  225.         if ($this->activities->removeElement($activity)) {
  226.             // set the owning side to null (unless already changed)
  227.             if ($activity->getLangue() === $this) {
  228.                 $activity->setLangue(null);
  229.             }
  230.         }
  231.         return $this;
  232.     }
  233. }