<?php
/**
* Product class represents model of ProductParameter entity
*
* $Project: Alliancemarkets2 $
* $Id$
*
* @package alliancemarkets2
* @author George Matyas <webexciter@yahoo.com>
* @version $Revision$
*/
// src/AppBundle/Entity/ProductParameter.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\ProductParameterRepo")
* @ORM\Table(name="product_parameter")
* @Gedmo\TranslationEntity(class="App\Entity\ProductParameterTranslation")
*/
class ProductParameter implements Translatable
{
const PARAMTYPE = array('PARAMTYPE_TEXT' => 0, 'PARAMTYPE_CHOICES' => 1, 'PARAMTYPE_TRUEFALSE' => 2);
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $productParameterId=0;
/**
* @Gedmo\Translatable
* @ORM\Column(type="string", length=255, nullable=true)
*/
protected $productParameterName;
/**
* @Gedmo\Translatable
* @ORM\Column(type="text", nullable=true)
*/
protected $productParameterDescription;
/**
* @Gedmo\Translatable
* @ORM\Column(type="text", nullable=true)
*/
protected $productParameterChoices;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
protected $unitName;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
protected $productParameterKey;
/**
* @ORM\Column(type="integer", nullable=true)
*/
protected $priority;
/**
* Post locale
* Used locale to override Translation listener's locale
*
* @Gedmo\Locale
*
*/
protected $locale;
/**
* @ORM\Column(type="integer", nullable=true)
*/
protected $parameterType = self::PARAMTYPE['PARAMTYPE_TEXT'];
/**
* @ORM\Column(type="boolean", nullable=true)
*/
protected $isVisible=true;
/**
* One ProductParameter has Many ProductParameterGroups.
* @ORM\ManyToMany(targetEntity="ProductParameterGroup")
* @ORM\JoinTable(name="product_parameter_groups",
* joinColumns={@ORM\JoinColumn(name="product_parameter_id", referencedColumnName="product_parameter_id")},
* inverseJoinColumns={@ORM\JoinColumn(name="product_parameter_group_id", referencedColumnName="product_parameter_group_id", unique=false)}
* )
*/
protected $productParameterGroups;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
protected $isFilterable=false;
public function __construct()
{
$this->productParameterGroups = new ArrayCollection();
}
public function getProductParameterId(): ?int
{
return $this->productParameterId;
}
public function getProductParameterName(): ?string
{
return $this->productParameterName;
}
public function setProductParameterName(?string $productParameterName): static
{
$this->productParameterName = $productParameterName;
return $this;
}
public function getProductParameterDescription(): ?string
{
return $this->productParameterDescription;
}
public function setProductParameterDescription(?string $productParameterDescription): static
{
$this->productParameterDescription = $productParameterDescription;
return $this;
}
public function getProductParameterChoices(): ?string
{
return $this->productParameterChoices;
}
public function setProductParameterChoices(?string $productParameterChoices): static
{
$this->productParameterChoices = $productParameterChoices;
return $this;
}
public function getUnitName(): ?string
{
return $this->unitName;
}
public function setUnitName(?string $unitName): static
{
$this->unitName = $unitName;
return $this;
}
public function getProductParameterKey(): ?string
{
return $this->productParameterKey;
}
public function setProductParameterKey(?string $productParameterKey): static
{
$this->productParameterKey = $productParameterKey;
return $this;
}
public function getPriority(): ?int
{
return $this->priority;
}
public function setPriority(?int $priority): static
{
$this->priority = $priority;
return $this;
}
public function getParameterType(): ?int
{
return $this->parameterType;
}
public function setParameterType(?int $parameterType): static
{
$this->parameterType = $parameterType;
return $this;
}
public function isIsVisible(): ?bool
{
return $this->isVisible;
}
public function setIsVisible(?bool $isVisible): static
{
$this->isVisible = $isVisible;
return $this;
}
public function isIsFilterable(): ?bool
{
return $this->isFilterable;
}
public function setIsFilterable(?bool $isFilterable): static
{
$this->isFilterable = $isFilterable;
return $this;
}
/**
* @return Collection<int, ProductParameterGroup>
*/
public function getProductParameterGroups(): Collection
{
return $this->productParameterGroups;
}
public function addProductParameterGroup(ProductParameterGroup $productParameterGroup): static
{
if (!$this->productParameterGroups->contains($productParameterGroup)) {
$this->productParameterGroups->add($productParameterGroup);
}
return $this;
}
public function removeProductParameterGroup(ProductParameterGroup $productParameterGroup): static
{
$this->productParameterGroups->removeElement($productParameterGroup);
return $this;
}
/**
* 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;
}
}