<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Gedmo\Translatable\Translatable;
/**
* @ORM\Entity(repositoryClass="App\EntityRepo\PriceLevelRepo")
* @ORM\Table(name="price_level")
* @Gedmo\TranslationEntity(class="App\Entity\PriceLevelTranslation")
*/
class PriceLevel implements Translatable
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $priceLevelId=0;
/**
* @Gedmo\Translatable
* @ORM\Column(type="string", length=100)
*/
protected $priceLevelName;
/**
* @Gedmo\Translatable
* @ORM\Column(type="text", nullable=true)
*/
protected $priceLevelDescription;
/**
* Post locale
* Used locale to override Translation listener's locale
*
* @Gedmo\Locale
*
*/
protected $locale;
/*
* @ORM\ManyToMany(targetEntity="Contact", mappedBy="priceLevel")
*/
//protected $contacts;
public function __construct()
{
$this->contacts = new ArrayCollection();
}
/**
* Get priceLevelId
*
* @return integer
*/
public function getPriceLevelId()
{
return $this->priceLevelId;
}
/**
* Set priceLevelName
*
* @param string $priceLevelName
*
* @return PriceLevel
*/
public function setPriceLevelName($priceLevelName)
{
$this->priceLevelName = $priceLevelName;
return $this;
}
/**
* Get priceLevelName
*
* @return string
*/
public function getPriceLevelName()
{
return $this->priceLevelName;
}
/**
* Set priceLevelDescription
*
* @param string $priceLevelDescription
*
* @return PriceLevel
*/
public function setPriceLevelDescription($priceLevelDescription)
{
$this->priceLevelDescription = $priceLevelDescription;
return $this;
}
/**
* Get priceLevelDescription
*
* @return string
*/
public function getPriceLevelDescription()
{
return $this->priceLevelDescription;
}
/**
* Set locale
*
* @param string $locale
*
* @return Product
*/
public function setLocale($locale)
{
$this->locale = $locale;
return $this;
}
/**
* Get locale
*
* @return string
*/
public function getLocale()
{
return $this->locale;
}
/**
* @return Collection<int, Contact>
*/
public function getContacts(): Collection
{
return $this->contacts;
}
public function addContact(Contact $contact): self
{
if (!$this->contacts->contains($contact)) {
$this->contacts->add($contact);
$contact->addPriceLevel($this);
}
return $this;
}
public function removeContact(Contact $contact): self
{
if ($this->contacts->removeElement($contact)) {
$contact->removePriceLevel($this);
}
return $this;
}
}