src/Entity/WebsiteLanguage.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\WebsiteLanguageRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassWebsiteLanguageRepository::class)]
  8. class WebsiteLanguage
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\Column(type'string'length255)]
  15.     private $name;
  16.     #[ORM\Column(type'string'length255)]
  17.     private $slug;
  18.     #[ORM\OneToMany(targetEntityArticle::class, mappedBy'websiteLanguage')]
  19.     private $articles;
  20.     #[ORM\OneToMany(targetEntityTutorial::class, mappedBy'websiteLanguage')]
  21.     private $tutorials;
  22.     #[ORM\OneToMany(targetEntityWebsiteInfo::class, mappedBy'websiteLanguage')]
  23.     private $websiteInfos;
  24.     #[ORM\OneToMany(targetEntityFaq::class, mappedBy'websiteLanguage')]
  25.     private $faqs;
  26.     #[ORM\OneToMany(targetEntityHomeSlider::class, mappedBy'websiteLanguage')]
  27.     private $homeSliders;
  28.     #[ORM\OneToMany(targetEntityMedia::class, mappedBy'websiteLanguage')]
  29.     private $media;
  30.     #[ORM\OneToMany(targetEntityCategory::class, mappedBy'websiteLanguage')]
  31.     private $categories;
  32.     #[ORM\OneToMany(targetEntityLegalInfo::class, mappedBy'language')]
  33.     private $LegalInfos;
  34.     public function __construct()
  35.     {
  36.         $this->articles = new ArrayCollection();
  37.         $this->tutorials = new ArrayCollection();
  38.         $this->websiteInfos = new ArrayCollection();
  39.         $this->faqs = new ArrayCollection();
  40.         $this->homeSliders = new ArrayCollection();
  41.         $this->media = new ArrayCollection();
  42.         $this->categories = new ArrayCollection();
  43.         $this->LegalInfos = new ArrayCollection();
  44.     }
  45.     public function __toString()
  46.     {
  47.         return $this->name;
  48.     }
  49.     public function getId(): ?int
  50.     {
  51.         return $this->id;
  52.     }
  53.     public function getName(): ?string
  54.     {
  55.         return $this->name;
  56.     }
  57.     public function setName(string $name): self
  58.     {
  59.         $this->name $name;
  60.         return $this;
  61.     }
  62.     public function getSlug(): ?string
  63.     {
  64.         return $this->slug;
  65.     }
  66.     public function setSlug(string $slug): self
  67.     {
  68.         $this->slug $slug;
  69.         return $this;
  70.     }
  71.     /**
  72.      * @return Collection|Article[]
  73.      */
  74.     public function getArticles(): Collection
  75.     {
  76.         return $this->articles;
  77.     }
  78.     public function addArticle(Article $article): self
  79.     {
  80.         if (!$this->articles->contains($article)) {
  81.             $this->articles[] = $article;
  82.             $article->setWebsiteLanguage($this);
  83.         }
  84.         return $this;
  85.     }
  86.     public function removeArticle(Article $article): self
  87.     {
  88.         if ($this->articles->removeElement($article)) {
  89.             // set the owning side to null (unless already changed)
  90.             if ($article->getWebsiteLanguage() === $this) {
  91.                 $article->setWebsiteLanguage(null);
  92.             }
  93.         }
  94.         return $this;
  95.     }
  96.     /**
  97.      * @return Collection|Tutorial[]
  98.      */
  99.     public function getTutorials(): Collection
  100.     {
  101.         return $this->tutorials;
  102.     }
  103.     public function addTutorial(Tutorial $tutorial): self
  104.     {
  105.         if (!$this->tutorials->contains($tutorial)) {
  106.             $this->tutorials[] = $tutorial;
  107.             $tutorial->setWebsiteLanguage($this);
  108.         }
  109.         return $this;
  110.     }
  111.     public function removeTutorial(Tutorial $tutorial): self
  112.     {
  113.         if ($this->tutorials->removeElement($tutorial)) {
  114.             // set the owning side to null (unless already changed)
  115.             if ($tutorial->getWebsiteLanguage() === $this) {
  116.                 $tutorial->setWebsiteLanguage(null);
  117.             }
  118.         }
  119.         return $this;
  120.     }
  121.     /**
  122.      * @return Collection|WebsiteInfo[]
  123.      */
  124.     public function getWebsiteInfos(): Collection
  125.     {
  126.         return $this->websiteInfos;
  127.     }
  128.     public function addWebsiteInfo(WebsiteInfo $websiteInfo): self
  129.     {
  130.         if (!$this->websiteInfos->contains($websiteInfo)) {
  131.             $this->websiteInfos[] = $websiteInfo;
  132.             $websiteInfo->setWebsiteLanguage($this);
  133.         }
  134.         return $this;
  135.     }
  136.     public function removeWebsiteInfo(WebsiteInfo $websiteInfo): self
  137.     {
  138.         if ($this->websiteInfos->removeElement($websiteInfo)) {
  139.             // set the owning side to null (unless already changed)
  140.             if ($websiteInfo->getWebsiteLanguage() === $this) {
  141.                 $websiteInfo->setWebsiteLanguage(null);
  142.             }
  143.         }
  144.         return $this;
  145.     }
  146.     /**
  147.      * @return Collection|Faq[]
  148.      */
  149.     public function getFaqs(): Collection
  150.     {
  151.         return $this->faqs;
  152.     }
  153.     public function addFaq(Faq $faq): self
  154.     {
  155.         if (!$this->faqs->contains($faq)) {
  156.             $this->faqs[] = $faq;
  157.             $faq->setWebsiteLanguage($this);
  158.         }
  159.         return $this;
  160.     }
  161.     public function removeFaq(Faq $faq): self
  162.     {
  163.         if ($this->faqs->removeElement($faq)) {
  164.             // set the owning side to null (unless already changed)
  165.             if ($faq->getWebsiteLanguage() === $this) {
  166.                 $faq->setWebsiteLanguage(null);
  167.             }
  168.         }
  169.         return $this;
  170.     }
  171.     /**
  172.      * @return Collection|HomeSlider[]
  173.      */
  174.     public function getHomeSliders(): Collection
  175.     {
  176.         return $this->homeSliders;
  177.     }
  178.     public function addHomeSlider(HomeSlider $homeSlider): self
  179.     {
  180.         if (!$this->homeSliders->contains($homeSlider)) {
  181.             $this->homeSliders[] = $homeSlider;
  182.             $homeSlider->setWebsiteLanguage($this);
  183.         }
  184.         return $this;
  185.     }
  186.     public function removeHomeSlider(HomeSlider $homeSlider): self
  187.     {
  188.         if ($this->homeSliders->removeElement($homeSlider)) {
  189.             // set the owning side to null (unless already changed)
  190.             if ($homeSlider->getWebsiteLanguage() === $this) {
  191.                 $homeSlider->setWebsiteLanguage(null);
  192.             }
  193.         }
  194.         return $this;
  195.     }
  196.     /**
  197.      * @return Collection|Media[]
  198.      */
  199.     public function getMedia(): Collection
  200.     {
  201.         return $this->media;
  202.     }
  203.     public function addMedium(Media $medium): self
  204.     {
  205.         if (!$this->media->contains($medium)) {
  206.             $this->media[] = $medium;
  207.             $medium->setWebsiteLanguage($this);
  208.         }
  209.         return $this;
  210.     }
  211.     public function removeMedium(Media $medium): self
  212.     {
  213.         if ($this->media->removeElement($medium)) {
  214.             // set the owning side to null (unless already changed)
  215.             if ($medium->getWebsiteLanguage() === $this) {
  216.                 $medium->setWebsiteLanguage(null);
  217.             }
  218.         }
  219.         return $this;
  220.     }
  221.     /**
  222.      * @return Collection|Category[]
  223.      */
  224.     public function getCategories(): Collection
  225.     {
  226.         return $this->categories;
  227.     }
  228.     public function addCategory(Category $category): self
  229.     {
  230.         if (!$this->categories->contains($category)) {
  231.             $this->categories[] = $category;
  232.             $category->setWebsiteLanguage($this);
  233.         }
  234.         return $this;
  235.     }
  236.     public function removeCategory(Category $category): self
  237.     {
  238.         if ($this->categories->removeElement($category)) {
  239.             // set the owning side to null (unless already changed)
  240.             if ($category->getWebsiteLanguage() === $this) {
  241.                 $category->setWebsiteLanguage(null);
  242.             }
  243.         }
  244.         return $this;
  245.     }
  246.     /**
  247.      * @return Collection|LegalInfo[]
  248.      */
  249.     public function getLegalInfos(): Collection
  250.     {
  251.         return $this->LegalInfos;
  252.     }
  253.     public function addLegalInfo(LegalInfo $LegalInfo): self
  254.     {
  255.         if (!$this->LegalInfos->contains($LegalInfo)) {
  256.             $this->LegalInfos[] = $LegalInfo;
  257.             $LegalInfo->setLanguage($this);
  258.         }
  259.         return $this;
  260.     }
  261.     public function removeLegalInfo(LegalInfo $LegalInfo): self
  262.     {
  263.         if ($this->LegalInfos->removeElement($LegalInfo)) {
  264.             // set the owning side to null (unless already changed)
  265.             if ($LegalInfo->getLanguage() === $this) {
  266.                 $LegalInfo->setLanguage(null);
  267.             }
  268.         }
  269.         return $this;
  270.     }
  271. }