<?php
namespace App\Entity;
use App\Repository\WebsiteLanguageRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: WebsiteLanguageRepository::class)]
class WebsiteLanguage
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255)]
private $name;
#[ORM\Column(type: 'string', length: 255)]
private $slug;
#[ORM\OneToMany(targetEntity: Article::class, mappedBy: 'websiteLanguage')]
private $articles;
#[ORM\OneToMany(targetEntity: Tutorial::class, mappedBy: 'websiteLanguage')]
private $tutorials;
#[ORM\OneToMany(targetEntity: WebsiteInfo::class, mappedBy: 'websiteLanguage')]
private $websiteInfos;
#[ORM\OneToMany(targetEntity: Faq::class, mappedBy: 'websiteLanguage')]
private $faqs;
#[ORM\OneToMany(targetEntity: HomeSlider::class, mappedBy: 'websiteLanguage')]
private $homeSliders;
#[ORM\OneToMany(targetEntity: Media::class, mappedBy: 'websiteLanguage')]
private $media;
#[ORM\OneToMany(targetEntity: Category::class, mappedBy: 'websiteLanguage')]
private $categories;
#[ORM\OneToMany(targetEntity: LegalInfo::class, mappedBy: 'language')]
private $LegalInfos;
public function __construct()
{
$this->articles = new ArrayCollection();
$this->tutorials = new ArrayCollection();
$this->websiteInfos = new ArrayCollection();
$this->faqs = new ArrayCollection();
$this->homeSliders = new ArrayCollection();
$this->media = new ArrayCollection();
$this->categories = new ArrayCollection();
$this->LegalInfos = new ArrayCollection();
}
public function __toString()
{
return $this->name;
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(string $slug): self
{
$this->slug = $slug;
return $this;
}
/**
* @return Collection|Article[]
*/
public function getArticles(): Collection
{
return $this->articles;
}
public function addArticle(Article $article): self
{
if (!$this->articles->contains($article)) {
$this->articles[] = $article;
$article->setWebsiteLanguage($this);
}
return $this;
}
public function removeArticle(Article $article): self
{
if ($this->articles->removeElement($article)) {
// set the owning side to null (unless already changed)
if ($article->getWebsiteLanguage() === $this) {
$article->setWebsiteLanguage(null);
}
}
return $this;
}
/**
* @return Collection|Tutorial[]
*/
public function getTutorials(): Collection
{
return $this->tutorials;
}
public function addTutorial(Tutorial $tutorial): self
{
if (!$this->tutorials->contains($tutorial)) {
$this->tutorials[] = $tutorial;
$tutorial->setWebsiteLanguage($this);
}
return $this;
}
public function removeTutorial(Tutorial $tutorial): self
{
if ($this->tutorials->removeElement($tutorial)) {
// set the owning side to null (unless already changed)
if ($tutorial->getWebsiteLanguage() === $this) {
$tutorial->setWebsiteLanguage(null);
}
}
return $this;
}
/**
* @return Collection|WebsiteInfo[]
*/
public function getWebsiteInfos(): Collection
{
return $this->websiteInfos;
}
public function addWebsiteInfo(WebsiteInfo $websiteInfo): self
{
if (!$this->websiteInfos->contains($websiteInfo)) {
$this->websiteInfos[] = $websiteInfo;
$websiteInfo->setWebsiteLanguage($this);
}
return $this;
}
public function removeWebsiteInfo(WebsiteInfo $websiteInfo): self
{
if ($this->websiteInfos->removeElement($websiteInfo)) {
// set the owning side to null (unless already changed)
if ($websiteInfo->getWebsiteLanguage() === $this) {
$websiteInfo->setWebsiteLanguage(null);
}
}
return $this;
}
/**
* @return Collection|Faq[]
*/
public function getFaqs(): Collection
{
return $this->faqs;
}
public function addFaq(Faq $faq): self
{
if (!$this->faqs->contains($faq)) {
$this->faqs[] = $faq;
$faq->setWebsiteLanguage($this);
}
return $this;
}
public function removeFaq(Faq $faq): self
{
if ($this->faqs->removeElement($faq)) {
// set the owning side to null (unless already changed)
if ($faq->getWebsiteLanguage() === $this) {
$faq->setWebsiteLanguage(null);
}
}
return $this;
}
/**
* @return Collection|HomeSlider[]
*/
public function getHomeSliders(): Collection
{
return $this->homeSliders;
}
public function addHomeSlider(HomeSlider $homeSlider): self
{
if (!$this->homeSliders->contains($homeSlider)) {
$this->homeSliders[] = $homeSlider;
$homeSlider->setWebsiteLanguage($this);
}
return $this;
}
public function removeHomeSlider(HomeSlider $homeSlider): self
{
if ($this->homeSliders->removeElement($homeSlider)) {
// set the owning side to null (unless already changed)
if ($homeSlider->getWebsiteLanguage() === $this) {
$homeSlider->setWebsiteLanguage(null);
}
}
return $this;
}
/**
* @return Collection|Media[]
*/
public function getMedia(): Collection
{
return $this->media;
}
public function addMedium(Media $medium): self
{
if (!$this->media->contains($medium)) {
$this->media[] = $medium;
$medium->setWebsiteLanguage($this);
}
return $this;
}
public function removeMedium(Media $medium): self
{
if ($this->media->removeElement($medium)) {
// set the owning side to null (unless already changed)
if ($medium->getWebsiteLanguage() === $this) {
$medium->setWebsiteLanguage(null);
}
}
return $this;
}
/**
* @return Collection|Category[]
*/
public function getCategories(): Collection
{
return $this->categories;
}
public function addCategory(Category $category): self
{
if (!$this->categories->contains($category)) {
$this->categories[] = $category;
$category->setWebsiteLanguage($this);
}
return $this;
}
public function removeCategory(Category $category): self
{
if ($this->categories->removeElement($category)) {
// set the owning side to null (unless already changed)
if ($category->getWebsiteLanguage() === $this) {
$category->setWebsiteLanguage(null);
}
}
return $this;
}
/**
* @return Collection|LegalInfo[]
*/
public function getLegalInfos(): Collection
{
return $this->LegalInfos;
}
public function addLegalInfo(LegalInfo $LegalInfo): self
{
if (!$this->LegalInfos->contains($LegalInfo)) {
$this->LegalInfos[] = $LegalInfo;
$LegalInfo->setLanguage($this);
}
return $this;
}
public function removeLegalInfo(LegalInfo $LegalInfo): self
{
if ($this->LegalInfos->removeElement($LegalInfo)) {
// set the owning side to null (unless already changed)
if ($LegalInfo->getLanguage() === $this) {
$LegalInfo->setLanguage(null);
}
}
return $this;
}
}