src/Entity/CompareParameterValue.php line 20

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Knp\DoctrineBehaviors\Contract\Entity\SoftDeletableInterface;
  4. use Knp\DoctrineBehaviors\Model\SoftDeletable\SoftDeletableTrait;
  5. use Knp\DoctrineBehaviors\Model\Blameable\BlameableTrait;
  6. use Knp\DoctrineBehaviors\Contract\Entity\BlameableInterface;
  7. use Knp\DoctrineBehaviors\Model\Timestampable\TimestampableTrait;
  8. use Knp\DoctrineBehaviors\Contract\Entity\TimestampableInterface;
  9. use Knp\DoctrineBehaviors\Model\Translatable\TranslatableTrait;
  10. use Knp\DoctrineBehaviors\Contract\Entity\TranslatableInterface;
  11. use Doctrine\ORM\Mapping as ORM;
  12. /**
  13.  * @Doctrine\ORM\Mapping\Entity
  14.  * @Doctrine\ORM\Mapping\Table(name="compare_parameter_value")
  15.  * @Doctrine\ORM\Mapping\Entity()
  16.  */
  17. class CompareParameterValue implements TranslatableInterfaceBlameableInterfaceTimestampableInterfaceSoftDeletableInterface  {
  18.     use BlameableTrait;
  19.     use TimestampableTrait;
  20.     use TranslatableTrait;
  21.     use SoftDeletableTrait;
  22.     /**
  23.      * @var integer
  24.      *
  25.      * @ORM\Column(name="id", type="integer", nullable=false)
  26.      * @ORM\Id
  27.      * @ORM\GeneratedValue(strategy="IDENTITY")
  28.      */
  29.     private $id;
  30.     /**
  31.      * @ORM\ManyToOne(targetEntity="App\Entity\CompareParameter", inversedBy="values")
  32.      */
  33.     private $parameter;
  34.     /**
  35.      * @ORM\ManyToOne(targetEntity="App\Entity\Category")
  36.      */
  37.     private $category;
  38.     /**
  39.      * @ORM\ManyToOne(targetEntity="App\Entity\Product", inversedBy="compareValues")
  40.      */
  41.     private $product;
  42.     /**
  43.      * Obsługa tłumaczeń
  44.      * @param $method
  45.      * @param $arguments
  46.      * @return mixed
  47.      */
  48.     public function __call($method$arguments)
  49.     {
  50.         return $this->proxyCurrentLocaleTranslation($method$arguments);
  51.     }
  52.     public function getValue(){
  53.         return $this->translate()->getValue();
  54.     }
  55.     public function getId(): ?int
  56.     {
  57.         return $this->id;
  58.     }
  59.     
  60.     public function getParameter(): ?CompareParameter
  61.     {
  62.         return $this->parameter;
  63.     }
  64.     public function setParameter(?CompareParameter $parameter): self
  65.     {
  66.         $this->parameter $parameter;
  67.         return $this;
  68.     }
  69.     public function getProduct(): ?Product
  70.     {
  71.         return $this->product;
  72.     }
  73.     public function setProduct(?Product $product): self
  74.     {
  75.         $this->product $product;
  76.         return $this;
  77.     }
  78.     public function getCategory(): ?Category
  79.     {
  80.         return $this->category;
  81.     }
  82.     public function setCategory(?Category $category): self
  83.     {
  84.         $this->category $category;
  85.         return $this;
  86.     }
  87. }