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="text", nullable=true)
  26.      */
  27.     private $intro;
  28.     /**
  29.      * @ORM\Column(type="string", length=255, nullable=true)
  30.      */
  31.     private $slug;
  32.     /**
  33.      * @ORM\OneToMany(targetEntity=About::class, mappedBy="langue")
  34.      */
  35.     private $abouts;
  36.     /**
  37.      * @ORM\OneToMany(targetEntity=Blog::class, mappedBy="langue")
  38.      */
  39.     private $blogs;
  40.     /**
  41.      * @ORM\OneToMany(targetEntity=SectionTitle::class, mappedBy="lang")
  42.      */
  43.     private $sectionTitles;
  44.     /**
  45.      * @ORM\OneToMany(targetEntity=Header::class, mappedBy="lang")
  46.      */
  47.     private $headers;
  48.     /**
  49.      * @ORM\OneToMany(targetEntity=News::class, mappedBy="langue")
  50.      */
  51.     private $news;
  52.     /**
  53.      * @ORM\OneToMany(targetEntity=Documents::class, mappedBy="langue")
  54.      */
  55.     private $documents;
  56.     /**
  57.      * @ORM\OneToMany(targetEntity=LangArea::class, mappedBy="lang")
  58.      */
  59.     private $langAreas;
  60.     /**
  61.      * @ORM\OneToMany(targetEntity=Teams::class, mappedBy="lang")
  62.      */
  63.     private $teams;
  64.     /**
  65.      * @ORM\OneToMany(targetEntity=Services::class, mappedBy="langue")
  66.      */
  67.     private $services;
  68.     public function __construct()
  69.     {
  70.         $this->abouts = new ArrayCollection();
  71.         $this->blogs = new ArrayCollection();
  72.         $this->sectionTitles = new ArrayCollection();
  73.         $this->headers = new ArrayCollection();
  74.         $this->news = new ArrayCollection();
  75.         $this->documents = new ArrayCollection();
  76.         $this->langAreas = new ArrayCollection();
  77.         $this->teams = new ArrayCollection();
  78.         $this->services = new ArrayCollection();
  79.     }
  80.     public function getId(): ?int
  81.     {
  82.         return $this->id;
  83.     }
  84.     public function getName(): ?string
  85.     {
  86.         return $this->name;
  87.     }
  88.     public function setName(string $name): self
  89.     {
  90.         $this->name = $name;
  91.         return $this;
  92.     }
  93.     public function getIntro(): ?string
  94.     {
  95.         return $this->intro;
  96.     }
  97.     public function setIntro(?string $intro): self
  98.     {
  99.         $this->intro = $intro;
  100.         return $this;
  101.     }
  102.     public function getSlug(): ?string
  103.     {
  104.         return $this->slug;
  105.     }
  106.     public function setSlug(?string $slug): self
  107.     {
  108.         $this->slug = $slug;
  109.         return $this;
  110.     }
  111.     public function getAbout(): ?About
  112.     {
  113.         return $this->about;
  114.     }
  115.     /**
  116.      * @return Collection<int, About>
  117.      */
  118.     public function getAbouts(): Collection
  119.     {
  120.         return $this->abouts;
  121.     }
  122.     public function addAbout(About $about): self
  123.     {
  124.         if (!$this->abouts->contains($about)) {
  125.             $this->abouts[] = $about;
  126.             $about->setLangue($this);
  127.         }
  128.         return $this;
  129.     }
  130.     public function removeAbout(About $about): self
  131.     {
  132.         if ($this->abouts->removeElement($about)) {
  133.             // set the owning side to null (unless already changed)
  134.             if ($about->getLangue() === $this) {
  135.                 $about->setLangue(null);
  136.             }
  137.         }
  138.         return $this;
  139.     }
  140.     /**
  141.      * @return Collection<int, Blog>
  142.      */
  143.     public function getBlogs(): Collection
  144.     {
  145.         return $this->blogs;
  146.     }
  147.     public function addBlog(Blog $blog): self
  148.     {
  149.         if (!$this->blogs->contains($blog)) {
  150.             $this->blogs[] = $blog;
  151.             $blog->setLangue($this);
  152.         }
  153.         return $this;
  154.     }
  155.     public function removeBlog(Blog $blog): self
  156.     {
  157.         if ($this->blogs->removeElement($blog)) {
  158.             // set the owning side to null (unless already changed)
  159.             if ($blog->getLangue() === $this) {
  160.                 $blog->setLangue(null);
  161.             }
  162.         }
  163.         return $this;
  164.     }
  165.     /**
  166.      * @return Collection<int, SectionTitle>
  167.      */
  168.     public function getSectionTitles(): Collection
  169.     {
  170.         return $this->sectionTitles;
  171.     }
  172.     public function addSectionTitle(SectionTitle $sectionTitle): self
  173.     {
  174.         if (!$this->sectionTitles->contains($sectionTitle)) {
  175.             $this->sectionTitles[] = $sectionTitle;
  176.             $sectionTitle->setLang($this);
  177.         }
  178.         return $this;
  179.     }
  180.     public function removeSectionTitle(SectionTitle $sectionTitle): self
  181.     {
  182.         if ($this->sectionTitles->removeElement($sectionTitle)) {
  183.             // set the owning side to null (unless already changed)
  184.             if ($sectionTitle->getLang() === $this) {
  185.                 $sectionTitle->setLang(null);
  186.             }
  187.         }
  188.         return $this;
  189.     }
  190.     /**
  191.      * @return Collection<int, Header>
  192.      */
  193.     public function getHeaders(): Collection
  194.     {
  195.         return $this->headers;
  196.     }
  197.     public function addHeader(Header $header): self
  198.     {
  199.         if (!$this->headers->contains($header)) {
  200.             $this->headers[] = $header;
  201.             $header->setLang($this);
  202.         }
  203.         return $this;
  204.     }
  205.     public function removeHeader(Header $header): self
  206.     {
  207.         if ($this->headers->removeElement($header)) {
  208.             // set the owning side to null (unless already changed)
  209.             if ($header->getLang() === $this) {
  210.                 $header->setLang(null);
  211.             }
  212.         }
  213.         return $this;
  214.     }
  215.     /**
  216.      * @return Collection<int, News>
  217.      */
  218.     public function getNews(): Collection
  219.     {
  220.         return $this->news;
  221.     }
  222.     public function addNews(News $news): self
  223.     {
  224.         if (!$this->news->contains($news)) {
  225.             $this->news[] = $news;
  226.             $news->setLangue($this);
  227.         }
  228.         return $this;
  229.     }
  230.     public function removeNews(News $news): self
  231.     {
  232.         if ($this->news->removeElement($news)) {
  233.             // set the owning side to null (unless already changed)
  234.             if ($news->getLangue() === $this) {
  235.                 $news->setLangue(null);
  236.             }
  237.         }
  238.         return $this;
  239.     }
  240.     public function __toString()
  241.     {
  242.         return $this->name;
  243.     }
  244.     /**
  245.      * @return Collection<int, Documents>
  246.      */
  247.     public function getDocuments(): Collection
  248.     {
  249.         return $this->documents;
  250.     }
  251.     public function addDocument(Documents $document): self
  252.     {
  253.         if (!$this->documents->contains($document)) {
  254.             $this->documents[] = $document;
  255.             $document->setLangue($this);
  256.         }
  257.         return $this;
  258.     }
  259.     public function removeDocument(Documents $document): self
  260.     {
  261.         if ($this->documents->removeElement($document)) {
  262.             // set the owning side to null (unless already changed)
  263.             if ($document->getLangue() === $this) {
  264.                 $document->setLangue(null);
  265.             }
  266.         }
  267.         return $this;
  268.     }
  269.     /**
  270.      * @return Collection<int, LangArea>
  271.      */
  272.     public function getLangAreas(): Collection
  273.     {
  274.         return $this->langAreas;
  275.     }
  276.     public function addLangArea(LangArea $langArea): self
  277.     {
  278.         if (!$this->langAreas->contains($langArea)) {
  279.             $this->langAreas[] = $langArea;
  280.             $langArea->setLang($this);
  281.         }
  282.         return $this;
  283.     }
  284.     public function removeLangArea(LangArea $langArea): self
  285.     {
  286.         if ($this->langAreas->removeElement($langArea)) {
  287.             // set the owning side to null (unless already changed)
  288.             if ($langArea->getLang() === $this) {
  289.                 $langArea->setLang(null);
  290.             }
  291.         }
  292.         return $this;
  293.     }
  294.     /**
  295.      * @return Collection<int, Teams>
  296.      */
  297.     public function getTeams(): Collection
  298.     {
  299.         return $this->teams;
  300.     }
  301.     public function addTeam(Teams $team): self
  302.     {
  303.         if (!$this->teams->contains($team)) {
  304.             $this->teams[] = $team;
  305.             $team->setLang($this);
  306.         }
  307.         return $this;
  308.     }
  309.     public function removeTeam(Teams $team): self
  310.     {
  311.         if ($this->teams->removeElement($team)) {
  312.             // set the owning side to null (unless already changed)
  313.             if ($team->getLang() === $this) {
  314.                 $team->setLang(null);
  315.             }
  316.         }
  317.         return $this;
  318.     }
  319.     /**
  320.      * @return Collection<int, Services>
  321.      */
  322.     public function getServices(): Collection
  323.     {
  324.         return $this->services;
  325.     }
  326.     public function addService(Services $service): self
  327.     {
  328.         if (!$this->services->contains($service)) {
  329.             $this->services[] = $service;
  330.             $service->setLangue($this);
  331.         }
  332.         return $this;
  333.     }
  334.     public function removeService(Services $service): self
  335.     {
  336.         if ($this->services->removeElement($service)) {
  337.             // set the owning side to null (unless already changed)
  338.             if ($service->getLangue() === $this) {
  339.                 $service->setLangue(null);
  340.             }
  341.         }
  342.         return $this;
  343.     }
  344. }