src/Entity/ProductField.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\EntityTrait;
  4. use App\Repository\ProductFieldRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass=ProductFieldRepository::class)
  8.  */
  9. class ProductField
  10. {
  11.     use EntityTrait{
  12.         EntityTrait::__construct as private __entityConstruct;
  13.     }
  14.     /**
  15.      * @ORM\Column(type="string", length=255)
  16.      */
  17.     private $label;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $type;
  22.     /**
  23.      * @ORM\Column(type="string", length=255, nullable=true)
  24.      */
  25.     private $unit;
  26.     /**
  27.      * @ORM\ManyToOne(targetEntity=Product::class, inversedBy="productFields", cascade={"persist"})
  28.      * @ORM\JoinColumn(nullable=false)
  29.      */
  30.     private $product;
  31.     /**
  32.      * @ORM\Column(type="boolean")
  33.      */
  34.     private $required;
  35.     /**
  36.      * @ORM\Column(type="json", nullable=true)
  37.      */
  38.     private $select_values;
  39.     /**
  40.      * @ORM\Column(type="json", nullable=true)
  41.      */
  42.     private $criterias;
  43.     /**
  44.      * @ORM\Column(type="integer")
  45.      */
  46.     private $sortorder;
  47.     public function getLabel(): ?string
  48.     {
  49.         return $this->label;
  50.     }
  51.     public function setLabel(string $label): self
  52.     {
  53.         $this->label $label;
  54.         return $this;
  55.     }
  56.     public function getType(): ?string
  57.     {
  58.         return $this->type;
  59.     }
  60.     public function setType(string $type): self
  61.     {
  62.         $this->type $type;
  63.         return $this;
  64.     }
  65.     public function getUnit(): ?string
  66.     {
  67.         return $this->unit;
  68.     }
  69.     public function setUnit(?string $unit): self
  70.     {
  71.         $this->unit $unit;
  72.         return $this;
  73.     }
  74.     public function getProduct(): ?Product
  75.     {
  76.         return $this->product;
  77.     }
  78.     public function setProduct(?Product $product): self
  79.     {
  80.         $this->product $product;
  81.         return $this;
  82.     }
  83.     public function __toString(){
  84.         return $this->getLabel();
  85.     }
  86.     public function getRequired(): ?bool
  87.     {
  88.         return $this->required;
  89.     }
  90.     public function setRequired(bool $required): self
  91.     {
  92.         $this->required $required;
  93.         return $this;
  94.     }
  95.     public function getSelectValues(): array
  96.     {
  97.         return $this->select_values;
  98.     }
  99.     public function setSelectValues(array $values): self
  100.     {
  101.         $this->select_values $values;
  102.         return $this;
  103.     }
  104.     public function getCriterias(): array
  105.     {
  106.         return $this->criterias;
  107.     }
  108.     public function setCriterias(array $values): self
  109.     {
  110.         $this->criterias $values;
  111.         return $this;
  112.     }
  113.     public function getSortorder(): ?int
  114.     {
  115.         return $this->sortorder;
  116.     }
  117.     public function setSortorder(int $sortorder): self
  118.     {
  119.         $this->sortorder $sortorder;
  120.         return $this;
  121.     }
  122. }