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.     /**
  69.      * @return Product
  70.      */
  71.     public function getProduct(): Product
  72.     {
  73.         return $this->product;
  74.     }
  75.     /**
  76.      * @param Product $product
  77.      *
  78.      * @return SpecificPrice
  79.      */
  80.     public function setProduct(Product $product): SpecificPrice
  81.     {
  82.         $this->product $product;
  83.         return $this;
  84.     }
  85.     /**
  86.      * @return ProductAttribute
  87.      */
  88.     public function getProductAttribute(): ProductAttribute
  89.     {
  90.         return $this->productAttribute;
  91.     }
  92.     /**
  93.      * @param ProductAttribute $productAttribute
  94.      *
  95.      * @return SpecificPrice
  96.      */
  97.     public function setProductAttribute(ProductAttribute $productAttribute): SpecificPrice
  98.     {
  99.         $this->productAttribute $productAttribute;
  100.         return $this;
  101.     }
  102.     /**
  103.      * @return float
  104.      */
  105.     public function getReduction(): float
  106.     {
  107.         return $this->reduction;
  108.     }
  109.     /**
  110.      * @param float $reduction
  111.      *
  112.      * @return SpecificPrice
  113.      */
  114.     public function setReduction(float $reduction): SpecificPrice
  115.     {
  116.         $this->reduction $reduction;
  117.         return $this;
  118.     }
  119.     /**
  120.      * @return int
  121.      */
  122.     public function getFromQuantity(): int
  123.     {
  124.         return $this->fromQuantity;
  125.     }
  126.     /**
  127.      * @param int $fromQuantity
  128.      *
  129.      * @return SpecificPrice
  130.      */
  131.     public function setFromQuantity(int $fromQuantity): SpecificPrice
  132.     {
  133.         $this->fromQuantity $fromQuantity;
  134.         return $this;
  135.     }
  136.     public function getReductionOld(): float
  137.     {
  138.         return $this->reductionOld;
  139.     }
  140.     public function setReductionOld(float $reductionOld): SpecificPrice
  141.     {
  142.         $this->reductionOld $reductionOld;
  143.         return $this;
  144.     }
  145. }