src/Entity/System/SpecificPrice.php line 18

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", indexes={
  8.  *
  9.  *     @ORM\Index(name="from_quantity", columns={"from_quantity"}),
  10.  *     @ORM\Index(name="id_product__from_quantity__id_product_attribute", columns={"id_product", "from_quantity", "id_product_attribute"}),
  11.  * })
  12.  *
  13.  * @ORM\Entity(repositoryClass="App\Repository\System\SpecificPriceRepository")
  14.  */
  15. class SpecificPrice
  16. {
  17.     public const DEFAULT_QUANTITY 1;
  18.     /**
  19.      * @var int
  20.      *
  21.      * @ORM\Column(name="id_specific_price", type="integer")
  22.      *
  23.      * @ORM\Id
  24.      *
  25.      * @ORM\GeneratedValue(strategy="AUTO")
  26.      */
  27.     private $id;
  28.     /**
  29.      * @var Product
  30.      *
  31.      * @ORM\ManyToOne(targetEntity="Product", inversedBy="specificPrices")
  32.      *
  33.      * @ORM\JoinColumn(name="id_product", referencedColumnName="id_product", nullable=false)
  34.      */
  35.     private $product;
  36.     /**
  37.      * @var ProductAttribute
  38.      *
  39.      * @ORM\ManyToOne(targetEntity="ProductAttribute", inversedBy="specificPrices")
  40.      *
  41.      * @ORM\JoinColumn(name="id_product_attribute", referencedColumnName="id_product_attribute")
  42.      */
  43.     private $productAttribute;
  44.     /**
  45.      * @var float
  46.      *
  47.      * @ORM\Column(name="reduction", type="float")
  48.      */
  49.     private $reduction;
  50.     /**
  51.      * @ORM\Column(name="reduction_old", type="float")
  52.      */
  53.     private float $reductionOld;
  54.     /**
  55.      * @var int
  56.      *
  57.      * @ORM\Column(name="from_quantity", type="integer")
  58.      */
  59.     private $fromQuantity;
  60.     /**
  61.      * @deprecated
  62.      *
  63.      * @var \DateTime
  64.      *
  65.      * @ORM\Column(name="`from`", type="datetime", nullable=true)
  66.      */
  67.     private $from;
  68.     /**
  69.      * @deprecated
  70.      *
  71.      * @var \DateTime
  72.      *
  73.      * @ORM\Column(name="`to`", type="datetime", nullable=true)
  74.      */
  75.     private $to;
  76.     /**
  77.      * @deprecated
  78.      *
  79.      * @var int
  80.      *
  81.      * @ORM\Column(type="integer", nullable=true)
  82.      */
  83.     private $idShop;
  84.     /**
  85.      * @deprecated
  86.      *
  87.      * @var int
  88.      *
  89.      * @ORM\Column(type="integer", nullable=true)
  90.      */
  91.     private $idCurrency;
  92.     /**
  93.      * @deprecated
  94.      *
  95.      * @var int
  96.      *
  97.      * @ORM\Column(type="integer", nullable=true)
  98.      */
  99.     private $idCountry;
  100.     /**
  101.      * @deprecated
  102.      *
  103.      * @var int
  104.      *
  105.      * @ORM\Column(type="integer", nullable=true)
  106.      */
  107.     private $idGroup;
  108.     /**
  109.      * @deprecated
  110.      *
  111.      * @var int
  112.      *
  113.      * @ORM\Column(type="integer", nullable=true)
  114.      */
  115.     private $idCustomer;
  116.     /**
  117.      * @deprecated
  118.      *
  119.      * @var int
  120.      *
  121.      * @ORM\Column(type="integer", nullable=true)
  122.      */
  123.     private $idShopGroup;
  124.     /**
  125.      * @deprecated
  126.      *
  127.      * @var int
  128.      *
  129.      * @ORM\Column(type="integer", nullable=true)
  130.      */
  131.     private $idCart;
  132.     /**
  133.      * @deprecated
  134.      *
  135.      * @var int
  136.      *
  137.      * @ORM\Column(type="integer", nullable=true)
  138.      */
  139.     private $idSpecificPriceRule;
  140.     /**
  141.      * @deprecated
  142.      *
  143.      * @var int
  144.      *
  145.      * @ORM\Column(type="integer", nullable=true)
  146.      */
  147.     private $price;
  148.     /**
  149.      * @deprecated
  150.      *
  151.      * @var float
  152.      *
  153.      * @ORM\Column(type="float", nullable=true)
  154.      */
  155.     private $reductionWhosalePrice;
  156.     /**
  157.      * @deprecated
  158.      *
  159.      * @var string
  160.      *
  161.      * @ORM\Column(type="string", columnDefinition="enum('amount', 'percentage')", nullable=false)
  162.      */
  163.     private $reductionType;
  164.     public function __construct()
  165.     {
  166.         $this->reduction 0.0;
  167.         $this->reductionOld 0.0;
  168.         $this->reductionType 'amount';
  169.     }
  170.     /**
  171.      * @return int
  172.      */
  173.     public function getId(): int
  174.     {
  175.         return $this->id;
  176.     }
  177.     public function getProduct(): Product
  178.     {
  179.         return $this->product;
  180.     }
  181.     /**
  182.      * @param Product $product
  183.      *
  184.      * @return SpecificPrice
  185.      */
  186.     public function setProduct(Product $product): SpecificPrice
  187.     {
  188.         $this->product $product;
  189.         return $this;
  190.     }
  191.     /**
  192.      * @return ProductAttribute
  193.      */
  194.     public function getProductAttribute(): ProductAttribute
  195.     {
  196.         return $this->productAttribute;
  197.     }
  198.     /**
  199.      * @param ProductAttribute $productAttribute
  200.      *
  201.      * @return SpecificPrice
  202.      */
  203.     public function setProductAttribute(ProductAttribute $productAttribute): SpecificPrice
  204.     {
  205.         $this->productAttribute $productAttribute;
  206.         return $this;
  207.     }
  208.     /**
  209.      * @return float
  210.      */
  211.     public function getReduction(): float
  212.     {
  213.         return $this->reduction;
  214.     }
  215.     /**
  216.      * @param float $reduction
  217.      *
  218.      * @return SpecificPrice
  219.      */
  220.     public function setReduction(float $reduction): SpecificPrice
  221.     {
  222.         $this->reduction $reduction;
  223.         return $this;
  224.     }
  225.     /**
  226.      * @return float
  227.      */
  228.     public function getReductionOld(): float
  229.     {
  230.         return $this->reductionOld;
  231.     }
  232.     /**
  233.      * @param float $reductionOld
  234.      *
  235.      * @return SpecificPrice
  236.      */
  237.     public function setReductionOld(float $reductionOld): SpecificPrice
  238.     {
  239.         $this->reductionOld $reductionOld;
  240.         return $this;
  241.     }
  242.     /**
  243.      * @return int
  244.      */
  245.     public function getFromQuantity(): int
  246.     {
  247.         return $this->fromQuantity;
  248.     }
  249.     /**
  250.      * @param int $fromQuantity
  251.      *
  252.      * @return SpecificPrice
  253.      */
  254.     public function setFromQuantity(int $fromQuantity): SpecificPrice
  255.     {
  256.         $this->fromQuantity $fromQuantity;
  257.         return $this;
  258.     }
  259.     public function getFrom(): \DateTime
  260.     {
  261.         return $this->from;
  262.     }
  263.     public function setFrom(\DateTime $from): SpecificPrice
  264.     {
  265.         $this->from $from;
  266.         return $this;
  267.     }
  268.     public function getTo(): \DateTime
  269.     {
  270.         return $this->to;
  271.     }
  272.     public function setTo(\DateTime $to): SpecificPrice
  273.     {
  274.         $this->to $to;
  275.         return $this;
  276.     }
  277.     public function getIdShop(): int
  278.     {
  279.         return $this->idShop;
  280.     }
  281.     public function setIdShop(int $idShop): SpecificPrice
  282.     {
  283.         $this->idShop $idShop;
  284.         return $this;
  285.     }
  286.     public function getIdCurrency(): int
  287.     {
  288.         return $this->idCurrency;
  289.     }
  290.     public function setIdCurrency(int $idCurrency): SpecificPrice
  291.     {
  292.         $this->idCurrency $idCurrency;
  293.         return $this;
  294.     }
  295.     public function getIdCountry(): int
  296.     {
  297.         return $this->idCountry;
  298.     }
  299.     public function setIdCountry(int $idCountry): SpecificPrice
  300.     {
  301.         $this->idCountry $idCountry;
  302.         return $this;
  303.     }
  304.     public function getIdGroup(): int
  305.     {
  306.         return $this->idGroup;
  307.     }
  308.     public function setIdGroup(int $idGroup): SpecificPrice
  309.     {
  310.         $this->idGroup $idGroup;
  311.         return $this;
  312.     }
  313.     public function getIdCustomer(): int
  314.     {
  315.         return $this->idCustomer;
  316.     }
  317.     public function setIdCustomer(int $idCustomer): SpecificPrice
  318.     {
  319.         $this->idCustomer $idCustomer;
  320.         return $this;
  321.     }
  322.     public function getIdShopGroup(): int
  323.     {
  324.         return $this->idShopGroup;
  325.     }
  326.     public function setIdShopGroup(int $idShopGroup): SpecificPrice
  327.     {
  328.         $this->idShopGroup $idShopGroup;
  329.         return $this;
  330.     }
  331.     public function getIdCart(): int
  332.     {
  333.         return $this->idCart;
  334.     }
  335.     public function setIdCart(int $idCart): SpecificPrice
  336.     {
  337.         $this->idCart $idCart;
  338.         return $this;
  339.     }
  340.     public function getIdSpecificPriceRule(): int
  341.     {
  342.         return $this->idSpecificPriceRule;
  343.     }
  344.     public function setIdSpecificPriceRule(int $idSpecificPriceRule): SpecificPrice
  345.     {
  346.         $this->idSpecificPriceRule $idSpecificPriceRule;
  347.         return $this;
  348.     }
  349.     public function getPrice(): int
  350.     {
  351.         return $this->price;
  352.     }
  353.     public function setPrice(int $price): SpecificPrice
  354.     {
  355.         $this->price $price;
  356.         return $this;
  357.     }
  358.     public function getReductionWhosalePrice(): float
  359.     {
  360.         return $this->reductionWhosalePrice;
  361.     }
  362.     public function setReductionWhosalePrice(float $reductionWhosalePrice): SpecificPrice
  363.     {
  364.         $this->reductionWhosalePrice $reductionWhosalePrice;
  365.         return $this;
  366.     }
  367.     public function getReductionType(): string
  368.     {
  369.         return $this->reductionType;
  370.     }
  371.     public function setReductionType(string $reductionType): SpecificPrice
  372.     {
  373.         $this->reductionType $reductionType;
  374.         return $this;
  375.     }
  376. }