src/Entity/System/CodeDiscount.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\System;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * Class CodeDiscount
  7.  *
  8.  * @ORM\Table(name="code_discount")
  9.  *
  10.  * @ORM\Entity(repositoryClass="App\Repository\System\CodeDiscountRepository")
  11.  */
  12. class CodeDiscount
  13. {
  14.     /**
  15.      * @ORM\Id()
  16.      *
  17.      * @ORM\GeneratedValue()
  18.      *
  19.      * @ORM\Column(type="integer")
  20.      */
  21.     private $id;
  22.     /**
  23.      * @var string
  24.      *
  25.      * @ORM\Column (type="string", length=30)
  26.      */
  27.     private $code;
  28.     /**
  29.      * @var bool
  30.      *
  31.      * @ORM\Column (type="boolean")
  32.      */
  33.     private $active;
  34.     /**
  35.      * @var Customer|null
  36.      *
  37.      * @ORM\ManyToOne(targetEntity="App\Entity\System\Customer", inversedBy="customerApi")
  38.      *
  39.      * @ORM\JoinColumn(name="customer", referencedColumnName="id_customer")
  40.      */
  41.     private $customer;
  42.     /**
  43.      * @var float
  44.      *
  45.      * @ORM\Column(type="decimal", precision=20, scale=6, options={"default" : 0.000000})
  46.      */
  47.     private $discount;
  48.     /**
  49.      * @var \DateTime|null
  50.      *
  51.      * @ORM\Column(type="datetime")
  52.      */
  53.     private $dateExpiration;
  54.     /**
  55.      * @var \DateTime|null
  56.      *
  57.      * @ORM\Column(type="datetime")
  58.      */
  59.     private $dateStarting;
  60.     /**
  61.      * @var Order[]|ArrayCollection
  62.      *
  63.      * @ORM\ManyToMany(targetEntity="App\Entity\System\Order", mappedBy="codeDiscount")
  64.      */
  65.     private $orders;
  66.     /**
  67.      * @var int|null
  68.      *
  69.      * @ORM\Column (type="integer")
  70.      */
  71.     private $type;
  72.     public function __construct()
  73.     {
  74.         $this->orders = new ArrayCollection();
  75.     }
  76.     /**
  77.      * @return mixed
  78.      */
  79.     public function getId()
  80.     {
  81.         return $this->id;
  82.     }
  83.     /**
  84.      * @return string
  85.      */
  86.     public function getCode(): string
  87.     {
  88.         return $this->code;
  89.     }
  90.     /**
  91.      * @return bool
  92.      */
  93.     public function isActive(): bool
  94.     {
  95.         return $this->active;
  96.     }
  97.     /**
  98.      * @return Customer|null
  99.      */
  100.     public function getCustomer(): ?Customer
  101.     {
  102.         return $this->customer;
  103.     }
  104.     /**
  105.      * @return float
  106.      */
  107.     public function getDiscount(): float
  108.     {
  109.         return $this->discount;
  110.     }
  111.     /**
  112.      * @return \DateTime|null
  113.      */
  114.     public function getDateExpiration(): ?\DateTime
  115.     {
  116.         return $this->dateExpiration;
  117.     }
  118.     /**
  119.      * @return \DateTime|null
  120.      */
  121.     public function getDateStarting(): ?\DateTime
  122.     {
  123.         return $this->dateStarting;
  124.     }
  125.     /**
  126.      * @return Order[]|ArrayCollection
  127.      */
  128.     public function getOrders()
  129.     {
  130.         return $this->orders;
  131.     }
  132.     /**
  133.      * @param Order[]|ArrayCollection $orders
  134.      */
  135.     public function setOrders($orders): self
  136.     {
  137.         $this->orders $orders;
  138.         return $this;
  139.     }
  140.     /**
  141.      * @return int|null
  142.      */
  143.     public function getType(): ?int
  144.     {
  145.         return $this->type;
  146.     }
  147.     /**
  148.      * @param int|null $type
  149.      */
  150.     public function setType(?int $type): void
  151.     {
  152.         $this->type $type;
  153.     }
  154.     public function setCode(string $code): CodeDiscount
  155.     {
  156.         $this->code $code;
  157.         return $this;
  158.     }
  159.     public function setActive(bool $active): CodeDiscount
  160.     {
  161.         $this->active $active;
  162.         return $this;
  163.     }
  164.     public function setCustomer(?Customer $customer): CodeDiscount
  165.     {
  166.         $this->customer $customer;
  167.         return $this;
  168.     }
  169.     public function setDiscount(float $discount): CodeDiscount
  170.     {
  171.         $this->discount $discount;
  172.         return $this;
  173.     }
  174.     public function setDateExpiration(?\DateTime $dateExpiration): CodeDiscount
  175.     {
  176.         $this->dateExpiration $dateExpiration;
  177.         return $this;
  178.     }
  179.     public function setDateStarting(?\DateTime $dateStarting): CodeDiscount
  180.     {
  181.         $this->dateStarting $dateStarting;
  182.         return $this;
  183.     }
  184. }