src/Entity/System/SpecificPrice.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\System;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * SpecificPrice
  6.  *
  7.  * @ORM\Table(name="ps_specific_price")
  8.  *
  9.  * @ORM\Entity(repositoryClass="App\Repository\System\SpecificPriceRepository")
  10.  */
  11. class SpecificPrice
  12. {
  13.     public const DEFAULT_QUANTITY 1;
  14.     /**
  15.      * @var int
  16.      *
  17.      * @ORM\Column(name="id_specific_price", type="integer")
  18.      *
  19.      * @ORM\Id
  20.      *
  21.      * @ORM\GeneratedValue(strategy="AUTO")
  22.      */
  23.     private $id;
  24.     /**
  25.      * @var Product
  26.      *
  27.      * @ORM\ManyToOne(targetEntity="Product", inversedBy="specificPrices")
  28.      *
  29.      * @ORM\JoinColumn(name="id_product", referencedColumnName="id_product")
  30.      */
  31.     private $product;
  32.     /**
  33.      * @var ProductAttribute
  34.      *
  35.      * @ORM\ManyToOne(targetEntity="ProductAttribute", inversedBy="specificPrices")
  36.      *
  37.      * @ORM\JoinColumn(name="id_product_attribute", referencedColumnName="id_product_attribute")
  38.      */
  39.     private $productAttribute;
  40.     /**
  41.      * @var float
  42.      *
  43.      * @ORM\Column(name="reduction", type="float")
  44.      */
  45.     private $reduction;
  46.     /**
  47.      * @ORM\Column(name="reduction_old", type="float")
  48.      */
  49.     private float $reductionOld;
  50.     /**
  51.      * @var int
  52.      *
  53.      * @ORM\Column(name="from_quantity", type="integer")
  54.      */
  55.     private $fromQuantity;
  56.     public function __construct()
  57.     {
  58.         $this->reduction 0.0;
  59.         $this->reductionOld 0.0;
  60.     }
  61.     /**
  62.      * @return int
  63.      */
  64.     public function getId(): int
  65.     {
  66.         return $this->id;
  67.     }
  68.     public function getProduct(): Product
  69.     {
  70.         return $this->product;
  71.     }
  72.     /**
  73.      * @param Product $product
  74.      *
  75.      * @return SpecificPrice
  76.      */
  77.     public function setProduct(Product $product): SpecificPrice
  78.     {
  79.         $this->product $product;
  80.         return $this;
  81.     }
  82.     /**
  83.      * @return ProductAttribute
  84.      */
  85.     public function getProductAttribute(): ProductAttribute
  86.     {
  87.         return $this->productAttribute;
  88.     }
  89.     /**
  90.      * @param ProductAttribute $productAttribute
  91.      *
  92.      * @return SpecificPrice
  93.      */
  94.     public function setProductAttribute(ProductAttribute $productAttribute): SpecificPrice
  95.     {
  96.         $this->productAttribute $productAttribute;
  97.         return $this;
  98.     }
  99.     /**
  100.      * @return float
  101.      */
  102.     public function getReduction(): float
  103.     {
  104.         return $this->reduction;
  105.     }
  106.     /**
  107.      * @param float $reduction
  108.      *
  109.      * @return SpecificPrice
  110.      */
  111.     public function setReduction(float $reduction): SpecificPrice
  112.     {
  113.         $this->reduction $reduction;
  114.         return $this;
  115.     }
  116.     /**
  117.      * @return float
  118.      */
  119.     public function getReductionOld(): float
  120.     {
  121.         return $this->reductionOld;
  122.     }
  123.     /**
  124.      * @param float $reductionOld
  125.      *
  126.      * @return SpecificPrice
  127.      */
  128.     public function setReductionOld(float $reductionOld): SpecificPrice
  129.     {
  130.         $this->reductionOld $reductionOld;
  131.         return $this;
  132.     }
  133.     /**
  134.      * @return int
  135.      */
  136.     public function getFromQuantity(): int
  137.     {
  138.         return $this->fromQuantity;
  139.     }
  140.     /**
  141.      * @param int $fromQuantity
  142.      *
  143.      * @return SpecificPrice
  144.      */
  145.     public function setFromQuantity(int $fromQuantity): SpecificPrice
  146.     {
  147.         $this->fromQuantity $fromQuantity;
  148.         return $this;
  149.     }
  150. }