src/Entity/System/MinimumOrderQuantity.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\System;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * MinimumOrderQuantity
  6.  *
  7.  * @ORM\Table(name="ps_minimum_order_quantity")
  8.  *
  9.  * @ORM\Entity(repositoryClass="App\Repository\System\MinimumOrderQuantityRepository")
  10.  */
  11. class MinimumOrderQuantity
  12. {
  13.     /**
  14.      * @var int
  15.      *
  16.      * @ORM\Column(name="id_order_minimum_quantity", type="integer")
  17.      *
  18.      * @ORM\Id
  19.      *
  20.      * @ORM\GeneratedValue(strategy="AUTO")
  21.      */
  22.     private $id;
  23.     /**
  24.      * @var Product
  25.      *
  26.      * @ORM\ManyToOne(targetEntity="Product", inversedBy="minimumOrderQuantitys")
  27.      *
  28.      * @ORM\JoinColumn(name="id_product", referencedColumnName="id_product")
  29.      */
  30.     private $product;
  31.     /**
  32.      * @var ProductAttribute
  33.      *
  34.      * @ORM\ManyToOne(targetEntity="ProductAttribute", inversedBy="minimumOrderQuantitys")
  35.      *
  36.      * @ORM\JoinColumn(name="id_product_attribute", referencedColumnName="id_product_attribute")
  37.      */
  38.     private $productAttribute;
  39.     /**
  40.      * @var int
  41.      *
  42.      * @ORM\Column(name="quantity", type="integer")
  43.      */
  44.     private $quantity;
  45.     /**
  46.      * @var float
  47.      *
  48.      * @ORM\Column(name="price", type="float")
  49.      */
  50.     private $price;
  51.     /**
  52.      * @var \DateTime
  53.      *
  54.      * @ORM\Column(name="date_add", type="datetime")
  55.      */
  56.     private $dateAdd;
  57.     public function __construct()
  58.     {
  59.         $this->dateAdd = new \DateTime();
  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 MinimumOrderQuantity
  79.      */
  80.     public function setProduct(Product $product): MinimumOrderQuantity
  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 MinimumOrderQuantity
  96.      */
  97.     public function setProductAttribute(ProductAttribute $productAttribute): MinimumOrderQuantity
  98.     {
  99.         $this->productAttribute $productAttribute;
  100.         return $this;
  101.     }
  102.     /**
  103.      * @return int
  104.      */
  105.     public function getQuantity(): int
  106.     {
  107.         return $this->quantity;
  108.     }
  109.     /**
  110.      * @param int $quantity
  111.      *
  112.      * @return MinimumOrderQuantity
  113.      */
  114.     public function setQuantity(int $quantity): MinimumOrderQuantity
  115.     {
  116.         $this->quantity $quantity;
  117.         return $this;
  118.     }
  119.     /**
  120.      * @return float
  121.      */
  122.     public function getPrice(): float
  123.     {
  124.         return $this->price;
  125.     }
  126.     /**
  127.      * @param float $price
  128.      *
  129.      * @return MinimumOrderQuantity
  130.      */
  131.     public function setPrice(float $price): MinimumOrderQuantity
  132.     {
  133.         $this->price $price;
  134.         return $this;
  135.     }
  136.     /**
  137.      * @return \DateTime
  138.      */
  139.     public function getDateAdd(): \DateTime
  140.     {
  141.         return $this->dateAdd;
  142.     }
  143.     /**
  144.      * @param \DateTime $dateAdd
  145.      *
  146.      * @return MinimumOrderQuantity
  147.      */
  148.     public function setDateAdd(\DateTime $dateAdd): MinimumOrderQuantity
  149.     {
  150.         $this->dateAdd $dateAdd;
  151.         return $this;
  152.     }
  153.     public function __toString()
  154.     {
  155.         return "Q: {$this->getQuantity()}, P: {$this->getPrice()},";
  156.     }
  157. }