<?php
namespace App\Entity\Gos;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* Term
*
* @ORM\Table(name="term")
* @ORM\Entity(repositoryClass="App\Repository\TermRepository")
* @ORM\HasLifecycleCallbacks
*/
class Term
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="name", type="string", length=255)
*/
private $name;
/**
* @var string
*
* @ORM\Column(name="title", type="text", nullable=true)
*/
private $title;
/**
* @var string
*
* @ORM\Column(type="text", nullable=true)
*/
private $titleOfShortDescription;
/**
* @var string
* @ORM\Column(type="text", nullable=true)
*/
private $shortDescription;
/**
* @var bool
*
* @ORM\Column(type="boolean", nullable=true)
*/
private $isRequired;
/**
* @var bool
*
* @ORM\Column(type="boolean")
*/
private $isReusable;
/**
* @var bool
*
* @ORM\Column(type="boolean", nullable=true)
*/
private $checked;
/**
* @var bool
*
* @ORM\Column(type="boolean", nullable=true)
*/
private $showInRegistration;
/**
* @var string
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $slug;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Gos\TermText", mappedBy="term")
*/
private $termText;
/**
* @ORM\OneToOne(targetEntity="App\Entity\Gos\TermText", mappedBy="activeTerm")
*/
private $activeTermText;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Gos\ProductVariant", inversedBy="terms")
* @ORM\JoinTable(name="product_variant_has_terms")
*/
private $productVariants;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Gos\Product", inversedBy="terms")
* @ORM\JoinTable(name="product_has_terms")
*/
private $products;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Gos\PortalSettings", inversedBy="terms")
* @ORM\JoinTable(name="portal_settings_has_terms")
*/
private $portalSettings;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Gos\TermType", inversedBy="terms")
* @ORM\JoinColumn()
*/
private $termType;
/**
* @ORM\ManyToOne(targetEntity="Language", inversedBy="terms")
* @ORM\JoinColumn()
*/
private $language;
/**
* @ORM\Column(type="datetime")
*/
private $createdAt;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updatedAt;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Gos\CooperatorGroup", inversedBy="terms")
*/
private $cooperatorGroup;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Gos\TermsValidationMessage", inversedBy="terms")
*/
private $termValidationMessage;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Gos\ClientType", inversedBy="terms")
*/
private $clientTypes;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $showDaysBefore;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Gos\LeadFormResponse", mappedBy="terms")
*/
private $leadFormResponses;
/**
* @ORM\ManyToMany(targetEntity=NewsletterTemplate::class, mappedBy="terms")
*/
private $newsletterTemplates;
/** @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;
}
//------------------------------ setters & getters
/**
* Constructor
*/
public function __construct()
{
$this->termText = new \Doctrine\Common\Collections\ArrayCollection();
$this->productVariants = new \Doctrine\Common\Collections\ArrayCollection();
$this->products = new \Doctrine\Common\Collections\ArrayCollection();
$this->portalSettings = new \Doctrine\Common\Collections\ArrayCollection();
$this->clientTypes = new ArrayCollection();
$this->leadFormResponses = new \Doctrine\Common\Collections\ArrayCollection();
$this->newsletterTemplates = new ArrayCollection();
}
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set name
*
* @param string $name
*
* @return Term
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Set title
*
* @param string $title
*
* @return Term
*/
public function setTitle($title)
{
$this->title = $title;
return $this;
}
/**
* Get title
*
* @return string
*/
public function getTitle()
{
return $this->title;
}
/**
* Set isRequired
*
* @param boolean $isRequired
*
* @return Term
*/
public function setIsRequired($isRequired)
{
$this->isRequired = $isRequired;
return $this;
}
/**
* Get isRequired
*
* @return boolean
*/
public function getIsRequired()
{
return $this->isRequired;
}
public function getIsReusable(): ?bool
{
return $this->isReusable;
}
public function setIsReusable(bool $isReusable): self
{
$this->isReusable = $isReusable;
return $this;
}
/**
* Set slug
*
* @param string $slug
*
* @return Term
*/
public function setSlug($slug)
{
$this->slug = $slug;
return $this;
}
/**
* Get slug
*
* @return string
*/
public function getSlug()
{
return $this->slug;
}
/**
* Set createdAt
*
* @param \DateTime $createdAt
*
* @return Term
*/
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 Term
*/
public function setUpdatedAt($updatedAt)
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* Get updatedAt
*
* @return \DateTime
*/
public function getUpdatedAt()
{
return $this->updatedAt;
}
/**
* Add termText
*
* @param \App\Entity\Gos\TermText $termText
*
* @return Term
*/
public function addTermText(\App\Entity\Gos\TermText $termText)
{
$this->termText[] = $termText;
return $this;
}
/**
* Remove termText
*
* @param \App\Entity\Gos\TermText $termText
*/
public function removeTermText(\App\Entity\Gos\TermText $termText)
{
$this->termText->removeElement($termText);
}
/**
* Get termText
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getTermText()
{
return $this->termText;
}
/**
* Set activeTermText
*
* @param \App\Entity\Gos\TermText $activeTermText
*
* @return Term
*/
public function setActiveTermText(\App\Entity\Gos\TermText $activeTermText = null)
{
$this->activeTermText = $activeTermText;
return $this;
}
/**
* Get activeTermText
*
* @return \App\Entity\Gos\TermText
*/
public function getActiveTermText()
{
return $this->activeTermText;
}
/**
* Add productVariant
*
* @param \App\Entity\Gos\ProductVariant $productVariant
*
* @return Term
*/
public function addProductVariant(\App\Entity\Gos\ProductVariant $productVariant)
{
$this->productVariants[] = $productVariant;
return $this;
}
/**
* Remove productVariant
*
* @param \App\Entity\Gos\ProductVariant $productVariant
*/
public function removeProductVariant(\App\Entity\Gos\ProductVariant $productVariant)
{
$this->productVariants->removeElement($productVariant);
}
/**
* Get productVariants
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getProductVariants()
{
return $this->productVariants;
}
/**
* Add product
*
* @param \App\Entity\Gos\Product $product
*
* @return Term
*/
public function addProduct(\App\Entity\Gos\Product $product)
{
$this->products[] = $product;
return $this;
}
/**
* Remove product
*
* @param \App\Entity\Gos\Product $product
*/
public function removeProduct(\App\Entity\Gos\Product $product)
{
$this->products->removeElement($product);
}
/**
* Get products
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getProducts()
{
return $this->products;
}
/**
* Add portalSetting
*
* @param \App\Entity\Gos\PortalSettings $portalSetting
*
* @return Term
*/
public function addPortalSetting(\App\Entity\Gos\PortalSettings $portalSetting)
{
$this->portalSettings[] = $portalSetting;
return $this;
}
/**
* Remove portalSetting
*
* @param \App\Entity\Gos\PortalSettings $portalSetting
*/
public function removePortalSetting(\App\Entity\Gos\PortalSettings $portalSetting)
{
$this->portalSettings->removeElement($portalSetting);
}
/**
* Get portalSettings
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getPortalSettings()
{
return $this->portalSettings;
}
/**
* Set termType
*
* @param \App\Entity\Gos\TermType $termType
*
* @return Term
*/
public function setTermType(\App\Entity\Gos\TermType $termType = null)
{
$this->termType = $termType;
return $this;
}
/**
* Get termType
*
* @return \App\Entity\Gos\TermType
*/
public function getTermType()
{
return $this->termType;
}
/**
* Set checked
*
* @param boolean $checked
*
* @return Term
*/
public function setChecked($checked)
{
$this->checked = $checked;
return $this;
}
/**
* Get checked
*
* @return boolean
*/
public function getChecked()
{
return $this->checked;
}
/**
* Set showInRegistration
*
* @param boolean $showInRegistration
*
* @return Term
*/
public function setShowInRegistration($showInRegistration)
{
$this->showInRegistration = $showInRegistration;
return $this;
}
/**
* Get showInRegistration
*
* @return boolean
*/
public function getShowInRegistration()
{
return $this->showInRegistration;
}
public function getTitleOfShortDescription(): ?string
{
return $this->titleOfShortDescription;
}
public function setTitleOfShortDescription(?string $titleOfShortDescription): self
{
$this->titleOfShortDescription = $titleOfShortDescription;
return $this;
}
public function getShortDescription(): ?string
{
return $this->shortDescription;
}
public function setShortDescription(?string $shortDescription): self
{
$this->shortDescription = $shortDescription;
return $this;
}
public function getLanguage(): ?Language
{
return $this->language;
}
public function setLanguage(?Language $language): self
{
$this->language = $language;
return $this;
}
public function getCooperatorGroup(): ?CooperatorGroup
{
return $this->cooperatorGroup;
}
public function setCooperatorGroup(?CooperatorGroup $cooperatorGroup): self
{
$this->cooperatorGroup = $cooperatorGroup;
return $this;
}
public function getTermValidationMessage(): ?TermsValidationMessage
{
return $this->termValidationMessage;
}
public function setTermValidationMessage(?TermsValidationMessage $termValidationMessage): self
{
$this->termValidationMessage = $termValidationMessage;
return $this;
}
public function getClientTypes()
{
return $this->clientTypes;
}
public function addClientType(ClientType $clientType): self
{
if (!$this->clientTypes->contains($clientType)) {
$this->clientTypes[] = $clientType;
}
return $this;
}
public function removeClientType(ClientType $clientType): self
{
if ($this->clientTypes->contains($clientType)) {
$this->clientTypes->removeElement($clientType);
}
return $this;
}
public function getShowDaysBefore(): ?int
{
return $this->showDaysBefore;
}
public function setShowDaysBefore(?int $showDaysBefore): self
{
$this->showDaysBefore = $showDaysBefore;
return $this;
}
public function getLeadFormResponses()
{
return $this->leadFormResponses;
}
public function addLeadFormResponse(LeadFormResponse $leadFormResponse): self
{
if (!$this->leadFormResponses->contains($leadFormResponse)) {
$this->leadFormResponses[] = $leadFormResponse;
}
return $this;
}
public function removeLeadFormResponse(LeadFormResponse $leadFormResponse): self
{
if ($this->clientTypes->contains($leadFormResponse)) {
$this->clientTypes->removeElement($leadFormResponse);
}
return $this;
}
/**
* @return Collection|NewsletterTemplate[]
*/
public function getNewsletterTemplates(): Collection
{
return $this->newsletterTemplates;
}
public function addNewsletterTemplate(NewsletterTemplate $newsletterTemplate): self
{
if (!$this->newsletterTemplates->contains($newsletterTemplate)) {
$this->newsletterTemplates[] = $newsletterTemplate;
$newsletterTemplate->addTerm($this);
}
return $this;
}
public function removeNewsletterTemplate(NewsletterTemplate $newsletterTemplate): self
{
if ($this->newsletterTemplates->contains($newsletterTemplate)) {
$this->newsletterTemplates->removeElement($newsletterTemplate);
$newsletterTemplate->removeTerm($this);
}
return $this;
}
}