src/AppBundle/Entity/CaracteristicaValor.php line 16
<?php
namespace AppBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use \AppBundle\Entity\Agrupador;
use Symfony\Component\String\Slugger\AsciiSlugger;
/**
* TipoCaracteristica.
*
* @ORM\Table(name="caracteristica_valor", uniqueConstraints={@ORM\UniqueConstraint(name="caracteristica_unique", columns={"caracteristica_id","valor_es"})})
* @ORM\Entity(repositoryClass="AppBundle\Repository\CaracteristicaValorRepository")
* @ORM\HasLifecycleCallbacks()
*/
class CaracteristicaValor
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="valor_es", type="string", length=255)
*/
private $valorEs;
/**
* @var string
*
* @ORM\Column(name="valor_en", type="string", length=255)
*/
private $valorEn;
/**
* @var string
*
* @ORM\Column(name="slug_es", type="string", length=255)
*/
private $slugEs;
/**
* @var string
*
* @ORM\Column(name="slug_en", type="string", length=255)
*/
private $slugEn;
/**
* @ORM\ManyToOne(targetEntity="Caracteristica", inversedBy="caracteristicasValor")
* @ORM\JoinColumn(name="caracteristica_id", referencedColumnName="id")
*/
protected $caracteristica;
/**
* @ORM\ManyToMany(targetEntity="Producto", mappedBy="caracteristicasValor", cascade={"persist"})
*/
protected $productos;
/**
* @ORM\ManyToOne(targetEntity="Agrupador", inversedBy="caracteristicasValor")
* @ORM\JoinColumn(name="agrupador_id", referencedColumnName="id")
*/
private $agrupador;
/**
* @var string
*
* @ORM\Column(name="clasificador", type="string", length=255, nullable=true)
*/
private $clasificador;
public function __construct()
{
$this->slugify = new AsciiSlugger();
$this->productos = new ArrayCollection();
}
/**
* Get id.
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set caracteristica.
*
* @param \AppBundle\Entity\Caracteristica $caracteristica
*
* @return TipoCaracteristica
*/
public function setCaracteristica(\AppBundle\Entity\Caracteristica $caracteristica = null)
{
$this->caracteristica = $caracteristica;
return $this;
}
/**
* Get caracteristica.
*
* @return \AppBundle\Entity\Caracteristica
*/
public function getCaracteristica()
{
return $this->caracteristica;
}
/**
* Add producto.
*
* @param \AppBundle\Entity\Producto $producto
*
* @return CaracteristicaValor
*/
public function addProducto(\AppBundle\Entity\Producto $producto)
{
$this->productos[] = $producto;
return $this;
}
/**
* Remove producto.
*
* @param \AppBundle\Entity\Producto $producto
*/
public function removeProducto(\AppBundle\Entity\Producto $producto)
{
$this->productos->removeElement($producto);
}
/**
* Get productos.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getProductos()
{
return $this->productos;
}
/**
* Set valorEs.
*
* @param string $valorEs
*
* @return CaracteristicaValor
*/
public function setValorEs($valorEs)
{
$this->valorEs = $valorEs;
return $this;
}
/**
* Get valorEs.
*
* @return string
*/
public function getValorEs()
{
return $this->valorEs;
}
/**
* Set valorEn.
*
* @param string $valorEn
*
* @return CaracteristicaValor
*/
public function setValorEn($valorEn)
{
$this->valorEn = $valorEn;
return $this;
}
/**
* Get valorEn.
*
* @return string
*/
public function getValorEn()
{
return $this->valorEn;
}
/**
* Set slugEs.
*
* @ORM\PreUpdate
* @ORM\PrePersist
*
* @param string $slugEs
*
* @return CaracteristicaValor
*/
public function setSlugEs()
{
$this->slugEs = $this->slugify->slug($this->valorEs)->lower();
return $this;
}
/**
* Get slugEs.
*
* @return string
*/
public function getSlugEs()
{
return $this->slugEs;
}
/**
* Set slugEn.
*
* @ORM\PreUpdate
* @ORM\PrePersist
*
* @param string $slugEn
*
* @return CaracteristicaValor
*/
public function setSlugEn()
{
$this->slugEn = $this->slugify->slug($this->valorEn)->lower();
return $this;
}
/**
* Get slugEn.
*
* @return string
*/
public function getSlugEn()
{
return $this->slugEn;
}
/**
* Set agrupador
*
* @param \AppBundle\Entity\Agrupador $agrupador
*
* @return CaracteristicaValor
*/
public function setAgrupador(Agrupador $agrupador = null)
{
$this->agrupador = $agrupador;
return $this;
}
/**
* Get agrupador
*
* @return \AppBundle\Entity\Agrupador
*/
public function getAgrupador()
{
return $this->agrupador;
}
/**
* Set clasificador.
*
* @param string $clasificador
*
* @return CaracteristicaValor
*/
public function setClasificador($clasificador)
{
$this->clasificador = $clasificador;
return $this;
}
/**
* Get clasificador.
*
* @return string
*/
public function getClasificador()
{
return $this->clasificador;
}
}