<?php
namespace App\Entity;
use App\Repository\LangRepository;
use App\Traits\CommonTrt;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=LangRepository::class)
*/
class Lang
{
use CommonTrt;
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $intro;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $slug;
/**
* @ORM\OneToMany(targetEntity=About::class, mappedBy="langue")
*/
private $abouts;
/**
* @ORM\OneToMany(targetEntity=Blog::class, mappedBy="langue")
*/
private $blogs;
/**
* @ORM\OneToMany(targetEntity=SectionTitle::class, mappedBy="lang")
*/
private $sectionTitles;
/**
* @ORM\OneToMany(targetEntity=Header::class, mappedBy="lang")
*/
private $headers;
/**
* @ORM\OneToMany(targetEntity=News::class, mappedBy="langue")
*/
private $news;
/**
* @ORM\OneToMany(targetEntity=Documents::class, mappedBy="langue")
*/
private $documents;
/**
* @ORM\OneToMany(targetEntity=LangArea::class, mappedBy="lang")
*/
private $langAreas;
/**
* @ORM\OneToMany(targetEntity=Teams::class, mappedBy="lang")
*/
private $teams;
/**
* @ORM\OneToMany(targetEntity=Services::class, mappedBy="langue")
*/
private $services;
public function __construct()
{
$this->abouts = new ArrayCollection();
$this->blogs = new ArrayCollection();
$this->sectionTitles = new ArrayCollection();
$this->headers = new ArrayCollection();
$this->news = new ArrayCollection();
$this->documents = new ArrayCollection();
$this->langAreas = new ArrayCollection();
$this->teams = new ArrayCollection();
$this->services = new ArrayCollection();
}
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 getIntro(): ?string
{
return $this->intro;
}
public function setIntro(?string $intro): self
{
$this->intro = $intro;
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(?string $slug): self
{
$this->slug = $slug;
return $this;
}
public function getAbout(): ?About
{
return $this->about;
}
/**
* @return Collection<int, About>
*/
public function getAbouts(): Collection
{
return $this->abouts;
}
public function addAbout(About $about): self
{
if (!$this->abouts->contains($about)) {
$this->abouts[] = $about;
$about->setLangue($this);
}
return $this;
}
public function removeAbout(About $about): self
{
if ($this->abouts->removeElement($about)) {
// set the owning side to null (unless already changed)
if ($about->getLangue() === $this) {
$about->setLangue(null);
}
}
return $this;
}
/**
* @return Collection<int, Blog>
*/
public function getBlogs(): Collection
{
return $this->blogs;
}
public function addBlog(Blog $blog): self
{
if (!$this->blogs->contains($blog)) {
$this->blogs[] = $blog;
$blog->setLangue($this);
}
return $this;
}
public function removeBlog(Blog $blog): self
{
if ($this->blogs->removeElement($blog)) {
// set the owning side to null (unless already changed)
if ($blog->getLangue() === $this) {
$blog->setLangue(null);
}
}
return $this;
}
/**
* @return Collection<int, SectionTitle>
*/
public function getSectionTitles(): Collection
{
return $this->sectionTitles;
}
public function addSectionTitle(SectionTitle $sectionTitle): self
{
if (!$this->sectionTitles->contains($sectionTitle)) {
$this->sectionTitles[] = $sectionTitle;
$sectionTitle->setLang($this);
}
return $this;
}
public function removeSectionTitle(SectionTitle $sectionTitle): self
{
if ($this->sectionTitles->removeElement($sectionTitle)) {
// set the owning side to null (unless already changed)
if ($sectionTitle->getLang() === $this) {
$sectionTitle->setLang(null);
}
}
return $this;
}
/**
* @return Collection<int, Header>
*/
public function getHeaders(): Collection
{
return $this->headers;
}
public function addHeader(Header $header): self
{
if (!$this->headers->contains($header)) {
$this->headers[] = $header;
$header->setLang($this);
}
return $this;
}
public function removeHeader(Header $header): self
{
if ($this->headers->removeElement($header)) {
// set the owning side to null (unless already changed)
if ($header->getLang() === $this) {
$header->setLang(null);
}
}
return $this;
}
/**
* @return Collection<int, News>
*/
public function getNews(): Collection
{
return $this->news;
}
public function addNews(News $news): self
{
if (!$this->news->contains($news)) {
$this->news[] = $news;
$news->setLangue($this);
}
return $this;
}
public function removeNews(News $news): self
{
if ($this->news->removeElement($news)) {
// set the owning side to null (unless already changed)
if ($news->getLangue() === $this) {
$news->setLangue(null);
}
}
return $this;
}
public function __toString()
{
return $this->name;
}
/**
* @return Collection<int, Documents>
*/
public function getDocuments(): Collection
{
return $this->documents;
}
public function addDocument(Documents $document): self
{
if (!$this->documents->contains($document)) {
$this->documents[] = $document;
$document->setLangue($this);
}
return $this;
}
public function removeDocument(Documents $document): self
{
if ($this->documents->removeElement($document)) {
// set the owning side to null (unless already changed)
if ($document->getLangue() === $this) {
$document->setLangue(null);
}
}
return $this;
}
/**
* @return Collection<int, LangArea>
*/
public function getLangAreas(): Collection
{
return $this->langAreas;
}
public function addLangArea(LangArea $langArea): self
{
if (!$this->langAreas->contains($langArea)) {
$this->langAreas[] = $langArea;
$langArea->setLang($this);
}
return $this;
}
public function removeLangArea(LangArea $langArea): self
{
if ($this->langAreas->removeElement($langArea)) {
// set the owning side to null (unless already changed)
if ($langArea->getLang() === $this) {
$langArea->setLang(null);
}
}
return $this;
}
/**
* @return Collection<int, Teams>
*/
public function getTeams(): Collection
{
return $this->teams;
}
public function addTeam(Teams $team): self
{
if (!$this->teams->contains($team)) {
$this->teams[] = $team;
$team->setLang($this);
}
return $this;
}
public function removeTeam(Teams $team): self
{
if ($this->teams->removeElement($team)) {
// set the owning side to null (unless already changed)
if ($team->getLang() === $this) {
$team->setLang(null);
}
}
return $this;
}
/**
* @return Collection<int, Services>
*/
public function getServices(): Collection
{
return $this->services;
}
public function addService(Services $service): self
{
if (!$this->services->contains($service)) {
$this->services[] = $service;
$service->setLangue($this);
}
return $this;
}
public function removeService(Services $service): self
{
if ($this->services->removeElement($service)) {
// set the owning side to null (unless already changed)
if ($service->getLangue() === $this) {
$service->setLangue(null);
}
}
return $this;
}
}