<?php
namespace App\Entity\Gos;
use App\Entity\Gos\Uniqskills\FmCompanySettings;
use App\Entity\Gos\Uniqskills\PromoBox;
use App\Entity\Gos\Uniqskills\Slider;
use App\Entity\Gos\Uniqskills\Voucher;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @ORM\Table()
* @ORM\Entity(repositoryClass="App\Repository\LanguageRepository")
* @ORM\HasLifecycleCallbacks
*/
class Language
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isActive;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\Column(type="string")
*/
private $native;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Gos\Country", mappedBy="language")
*/
private $country;
/**
* @Gedmo\Slug(fields={"name"})
* @ORM\Column(unique=true)
*/
private $slug;
/**
* @ORM\Column(type="string", length=5)
*/
private $code;
/**
* @ORM\Column(type="string", length=6, nullable=true)
*/
private $short;
/**
* @ORM\OneToMany(targetEntity="EmailTemplate", mappedBy="language")
*/
private $emailTemplate;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Gos\Category", mappedBy="language")
*/
private $categories;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Gos\Uniqskills\PromoBox", mappedBy="language")
*/
private $promoBox;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Gos\Uniqskills\Slider", mappedBy="language")
*/
private $slider;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Gos\Uniqskills\FmCompanySettings", mappedBy="language")
*/
private $fmCompanySettings;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Gos\Uniqskills\Voucher", mappedBy="isDefaultForLanguage")
*/
private $vouchers;
/**
* @ORM\OneToMany(targetEntity="Term", mappedBy="language")
*/
private $terms;
/**
* @ORM\Column(type="datetime")
*/
private $createdAt;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updatedAt;
/**
* @ORM\OneToMany(targetEntity="NotificationForUser", mappedBy="language")
*/
private $notificationForUser;
/** @ORM\PrePersist() */
public function prePersist()
{
$this->createdAt = new \DateTime();
}
/** @ORM\PreUpdate() */
public function preUpdate()
{
$this->updatedAt = new \DateTime();
}
public function __toString()
{
return (string)$this->name;
}
/* ****************************** GETTERS & SETTERS ****************************** */
/**
* Constructor
*/
public function __construct()
{
$this->country = new ArrayCollection();
$this->vouchers = new ArrayCollection();
$this->slider = new ArrayCollection();
$this->promoBox = new ArrayCollection();
$this->categories = new ArrayCollection();
$this->emailTemplate = new ArrayCollection();
$this->fmCompanySettings = new ArrayCollection();
$this->terms = new ArrayCollection();
$this->notificationForUser = new ArrayCollection();
}
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set isActive
*
* @param boolean $isActive
* @return Language
*/
public function setIsActive($isActive)
{
$this->isActive = $isActive;
return $this;
}
/**
* Get isActive
*
* @return boolean
*/
public function getIsActive()
{
return $this->isActive;
}
/**
* Set name
*
* @param string $name
* @return Language
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Set native
*
* @param string $native
* @return Language
*/
public function setNative($native)
{
$this->native = $native;
return $this;
}
/**
* Get native
*
* @return string
*/
public function getNative()
{
return $this->native;
}
/**
* Set slug
*
* @param string $slug
* @return Language
*/
public function setSlug($slug)
{
$this->slug = $slug;
return $this;
}
/**
* Get slug
*
* @return string
*/
public function getSlug()
{
return $this->slug;
}
/**
* Set code
*
* @param string $code
* @return Language
*/
public function setCode($code)
{
$this->code = $code;
return $this;
}
/**
* Get code
*
* @return string
*/
public function getCode()
{
return $this->code;
}
/**
* Set createdAt
*
* @param \DateTime $createdAt
* @return Language
*/
public function setCreatedAt($createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
/**
* Get createdAt
*
* @return \DateTime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* Set updatedAt
*
* @param \DateTime $updatedAt
* @return Language
*/
public function setUpdatedAt($updatedAt)
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* Get updatedAt
*
* @return \DateTime
*/
public function getUpdatedAt()
{
return $this->updatedAt;
}
/**
* Set short
*
* @param string $short
*
* @return Language
*/
public function setShort($short)
{
$this->short = $short;
return $this;
}
/**
* Get short
*
* @return string
*/
public function getShort()
{
return $this->short;
}
/**
* Add country
*
* @param \App\Entity\Gos\Country $country
*
* @return Language
*/
public function addCountry(\App\Entity\Gos\Country $country)
{
$this->country[] = $country;
return $this;
}
/**
* Remove country
*
* @param \App\Entity\Gos\Country $country
*/
public function removeCountry(\App\Entity\Gos\Country $country)
{
$this->country->removeElement($country);
}
/**
* Get country
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getCountry()
{
return $this->country;
}
/**
* @return Collection|Voucher[]
*/
public function getVouchers(): Collection
{
return $this->vouchers;
}
public function addVoucher(Voucher $voucher): self
{
if (!$this->vouchers->contains($voucher)) {
$this->vouchers[] = $voucher;
$voucher->addIsDefaultForLanguage($this);
}
return $this;
}
public function removeVoucher(Voucher $voucher): self
{
if ($this->vouchers->contains($voucher)) {
$this->vouchers->removeElement($voucher);
$voucher->removeIsDefaultForLanguage($this);
}
return $this;
}
/**
* @return Collection|Slider[]
*/
public function getSlider(): Collection
{
return $this->slider;
}
public function addSlider(Slider $slider): self
{
if (!$this->slider->contains($slider)) {
$this->slider[] = $slider;
$slider->setLanguage($this);
}
return $this;
}
public function removeSlider(Slider $slider): self
{
if ($this->slider->contains($slider)) {
$this->slider->removeElement($slider);
// set the owning side to null (unless already changed)
if ($slider->getLanguage() === $this) {
$slider->setLanguage(null);
}
}
return $this;
}
/**
* @return Collection|PromoBox[]
*/
public function getPromoBox(): Collection
{
return $this->promoBox;
}
public function addPromoBox(PromoBox $promoBox): self
{
if (!$this->promoBox->contains($promoBox)) {
$this->promoBox[] = $promoBox;
$promoBox->setLanguage($this);
}
return $this;
}
public function removePromoBox(PromoBox $promoBox): self
{
if ($this->promoBox->contains($promoBox)) {
$this->promoBox->removeElement($promoBox);
// set the owning side to null (unless already changed)
if ($promoBox->getLanguage() === $this) {
$promoBox->setLanguage(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->setLanguage($this);
}
return $this;
}
public function removeCategory(Category $category): self
{
if ($this->categories->contains($category)) {
$this->categories->removeElement($category);
// set the owning side to null (unless already changed)
if ($category->getLanguage() === $this) {
$category->setLanguage(null);
}
}
return $this;
}
/**
* @return Collection|EmailTemplate[]
*/
public function getEmailTemplate(): Collection
{
return $this->emailTemplate;
}
public function addEmailTemplate(EmailTemplate $emailTemplate): self
{
if (!$this->emailTemplate->contains($emailTemplate)) {
$this->emailTemplate[] = $emailTemplate;
$emailTemplate->setLanguage($this);
}
return $this;
}
public function removeEmailTemplate(EmailTemplate $emailTemplate): self
{
if ($this->emailTemplate->contains($emailTemplate)) {
$this->emailTemplate->removeElement($emailTemplate);
// set the owning side to null (unless already changed)
if ($emailTemplate->getLanguage() === $this) {
$emailTemplate->setLanguage(null);
}
}
return $this;
}
/**
* @return Collection|FmCompanySettings[]
*/
public function getFmCompanySettings(): Collection
{
return $this->fmCompanySettings;
}
public function addFmCompanySetting(FmCompanySettings $fmCompanySetting): self
{
if (!$this->fmCompanySettings->contains($fmCompanySetting)) {
$this->fmCompanySettings[] = $fmCompanySetting;
$fmCompanySetting->addLanguage($this);
}
return $this;
}
public function removeFmCompanySetting(FmCompanySettings $fmCompanySetting): self
{
if ($this->fmCompanySettings->contains($fmCompanySetting)) {
$this->fmCompanySettings->removeElement($fmCompanySetting);
$fmCompanySetting->removeLanguage($this);
}
return $this;
}
/**
* @return Collection|Term[]
*/
public function getTerms(): Collection
{
return $this->terms;
}
public function addTerm(Term $term): self
{
if (!$this->terms->contains($term)) {
$this->terms[] = $term;
$term->setLanguage($this);
}
return $this;
}
public function removeTerm(Term $term): self
{
if ($this->terms->contains($term)) {
$this->terms->removeElement($term);
// set the owning side to null (unless already changed)
if ($term->getLanguage() === $this) {
$term->setLanguage(null);
}
}
return $this;
}
/**
* @return Collection|Language[]
*/
public function getNotificationForUser(): Collection
{
return $this->notificationForUser;
}
public function addNotificationForUser(NotificationForUser $notificationForUser): self
{
if (!$this->notificationForUser->contains($notificationForUser)) {
$this->notificationForUser[] = $notificationForUser;
$notificationForUser->setCourse($this);
}
return $this;
}
public function removeNotificationForUser(NotificationForUser $notificationForUser): self
{
if ($this->notificationForUser->contains($notificationForUser)) {
$this->notificationForUser->removeElement($notificationForUser);
}
return $this;
}
}