src/Entity/ProductParameter.php line 28

Open in your IDE?
  1. <?php
  2. /**
  3.  * Product class represents model of ProductParameter entity
  4.  *
  5.  * $Project: Alliancemarkets2 $
  6.  * $Id$
  7.  *
  8.  * @package alliancemarkets2
  9.  * @author George Matyas <webexciter@yahoo.com>
  10.  * @version $Revision$
  11.  */
  12. // src/AppBundle/Entity/ProductParameter.php
  13. namespace App\Entity;
  14. use Doctrine\Common\Collections\ArrayCollection;
  15. use Doctrine\Common\Collections\Collection;
  16. use Doctrine\DBAL\Types\Types;
  17. use Doctrine\ORM\Mapping as ORM;
  18. use Gedmo\Mapping\Annotation as Gedmo;
  19. use Gedmo\Translatable\Translatable;
  20. /**
  21.  * @ORM\Entity(repositoryClass="App\EntityRepo\ProductParameterRepo")
  22.  * @ORM\Table(name="product_parameter")
  23.  * @Gedmo\TranslationEntity(class="App\Entity\ProductParameterTranslation")
  24.  */
  25. class ProductParameter implements Translatable
  26. {
  27.     const PARAMTYPE = array('PARAMTYPE_TEXT' => 0'PARAMTYPE_CHOICES' => 1'PARAMTYPE_TRUEFALSE' => 2);
  28.     /**
  29.      * @ORM\Column(type="integer")
  30.      * @ORM\Id
  31.      * @ORM\GeneratedValue(strategy="AUTO")
  32.      */ 
  33.     protected $productParameterId=0;
  34.     
  35.     /**
  36.      * @Gedmo\Translatable
  37.      * @ORM\Column(type="string", length=255, nullable=true)
  38.      */
  39.     protected $productParameterName;
  40.     
  41.     /**
  42.      * @Gedmo\Translatable
  43.      * @ORM\Column(type="text", nullable=true)
  44.      */
  45.     protected $productParameterDescription;
  46.     /**
  47.      * @Gedmo\Translatable
  48.      * @ORM\Column(type="text", nullable=true)
  49.      */
  50.     protected $productParameterChoices;
  51.     /**
  52.      * @ORM\Column(type="string", length=100, nullable=true)
  53.      */
  54.     protected $unitName;        
  55.     
  56.     /**
  57.      * @ORM\Column(type="string", length=100, nullable=true)
  58.      */
  59.     protected $productParameterKey;  
  60.     /**
  61.      * @ORM\Column(type="integer", nullable=true)
  62.      */
  63.     protected $priority;  
  64.     /**
  65.      * Post locale
  66.      * Used locale to override Translation listener's locale
  67.      *
  68.      * @Gedmo\Locale
  69.      * 
  70.      */
  71.     protected $locale;
  72.     
  73.     /**
  74.      * @ORM\Column(type="integer", nullable=true)
  75.      */    
  76.     protected $parameterType self::PARAMTYPE['PARAMTYPE_TEXT'];      
  77.     
  78.     /**
  79.      * @ORM\Column(type="boolean", nullable=true)
  80.      */
  81.     protected $isVisible=true;       
  82.     /**
  83.      * One ProductParameter has Many ProductParameterGroups.
  84.      * @ORM\ManyToMany(targetEntity="ProductParameterGroup")
  85.      * @ORM\JoinTable(name="product_parameter_groups",
  86.      *      joinColumns={@ORM\JoinColumn(name="product_parameter_id", referencedColumnName="product_parameter_id")},
  87.      *      inverseJoinColumns={@ORM\JoinColumn(name="product_parameter_group_id", referencedColumnName="product_parameter_group_id", unique=false)}
  88.      *      )
  89.      */
  90.     protected $productParameterGroups;  
  91.     /**
  92.      * @ORM\Column(type="boolean", nullable=true)
  93.      */
  94.     protected $isFilterable=false;
  95.     public function __construct()
  96.     {
  97.         $this->productParameterGroups = new ArrayCollection();
  98.     }
  99.     public function getProductParameterId(): ?int
  100.     {
  101.         return $this->productParameterId;
  102.     }
  103.     public function getProductParameterName(): ?string
  104.     {
  105.         return $this->productParameterName;
  106.     }
  107.     public function setProductParameterName(?string $productParameterName): static
  108.     {
  109.         $this->productParameterName $productParameterName;
  110.         return $this;
  111.     }
  112.     public function getProductParameterDescription(): ?string
  113.     {
  114.         return $this->productParameterDescription;
  115.     }
  116.     public function setProductParameterDescription(?string $productParameterDescription): static
  117.     {
  118.         $this->productParameterDescription $productParameterDescription;
  119.         return $this;
  120.     }
  121.     public function getProductParameterChoices(): ?string
  122.     {
  123.         return $this->productParameterChoices;
  124.     }
  125.     public function setProductParameterChoices(?string $productParameterChoices): static
  126.     {
  127.         $this->productParameterChoices $productParameterChoices;
  128.         return $this;
  129.     }
  130.     public function getUnitName(): ?string
  131.     {
  132.         return $this->unitName;
  133.     }
  134.     public function setUnitName(?string $unitName): static
  135.     {
  136.         $this->unitName $unitName;
  137.         return $this;
  138.     }
  139.     public function getProductParameterKey(): ?string
  140.     {
  141.         return $this->productParameterKey;
  142.     }
  143.     public function setProductParameterKey(?string $productParameterKey): static
  144.     {
  145.         $this->productParameterKey $productParameterKey;
  146.         return $this;
  147.     }
  148.     public function getPriority(): ?int
  149.     {
  150.         return $this->priority;
  151.     }
  152.     public function setPriority(?int $priority): static
  153.     {
  154.         $this->priority $priority;
  155.         return $this;
  156.     }
  157.     public function getParameterType(): ?int
  158.     {
  159.         return $this->parameterType;
  160.     }
  161.     public function setParameterType(?int $parameterType): static
  162.     {
  163.         $this->parameterType $parameterType;
  164.         return $this;
  165.     }
  166.     public function isIsVisible(): ?bool
  167.     {
  168.         return $this->isVisible;
  169.     }
  170.     public function setIsVisible(?bool $isVisible): static
  171.     {
  172.         $this->isVisible $isVisible;
  173.         return $this;
  174.     }
  175.     public function isIsFilterable(): ?bool
  176.     {
  177.         return $this->isFilterable;
  178.     }
  179.     public function setIsFilterable(?bool $isFilterable): static
  180.     {
  181.         $this->isFilterable $isFilterable;
  182.         return $this;
  183.     }
  184.     /**
  185.      * @return Collection<int, ProductParameterGroup>
  186.      */
  187.     public function getProductParameterGroups(): Collection
  188.     {
  189.         return $this->productParameterGroups;
  190.     }
  191.     public function addProductParameterGroup(ProductParameterGroup $productParameterGroup): static
  192.     {
  193.         if (!$this->productParameterGroups->contains($productParameterGroup)) {
  194.             $this->productParameterGroups->add($productParameterGroup);
  195.         }
  196.         return $this;
  197.     }
  198.     public function removeProductParameterGroup(ProductParameterGroup $productParameterGroup): static
  199.     {
  200.         $this->productParameterGroups->removeElement($productParameterGroup);
  201.         return $this;
  202.     }
  203.     /**
  204.      * Set locale
  205.      *
  206.      * @param string $locale
  207.      *
  208.      * @return Product
  209.      */
  210.     public function setLocale($locale)
  211.     {
  212.         $this->locale $locale;
  213.         return $this;
  214.     }
  215.     /**
  216.      * Get locale
  217.      *
  218.      * @return string
  219.      */
  220.     public function getLocale()
  221.     {
  222.         return $this->locale;
  223.     }
  224. }