src/Component/Order/Model/Order.php line 18

Open in your IDE?
  1. <?php
  2. declare (strict_types 1);
  3. namespace App\Component\Order\Model;
  4. use App\Component\Core\Model\TimestampableTrait;
  5. use App\Component\Discount\Model\Discount;
  6. use App\Component\Discount\Model\DiscountInterface;
  7. use App\Component\Payment\Model\Payment;
  8. use App\Component\Payment\Model\PaymentInterface;
  9. use App\Component\Shipment\Model\Shipment;
  10. use App\Component\Shipment\Model\ShipmentInterface;
  11. use App\Entity\User;
  12. use Doctrine\Common\Collections\ArrayCollection;
  13. use Doctrine\Common\Collections\Collection;
  14. class Order implements OrderInterface
  15. {
  16.     use TimestampableTrait;
  17.     /**
  18.      * @var string
  19.      */
  20.     private $id;
  21.     /**
  22.      * @var Collection
  23.      */
  24.     private $items;
  25.     /**
  26.      * @var PaymentInterface
  27.      */
  28.     private $payment;
  29.      /**
  30.      * @var int
  31.      */
  32.     private $cart_cat;
  33.       /**
  34.      * @var int
  35.      */
  36.     private $status =0;
  37.     
  38.     /**
  39.      * @var ShipmentInterface
  40.      */
  41.     private $shipment;
  42.     /**
  43.      * @var int
  44.      */
  45.     private $user 0;
  46.     /**
  47.      * @var DiscountInterface
  48.      */
  49.     private $discount;
  50.     /**
  51.      * @var int
  52.      */
  53.     private $itemsTotal 0;
  54.     /**
  55.      * @var float
  56.      */
  57.     private $itemsPriceTotal 0;
  58.     /**
  59.      * @var float
  60.      */
  61.     private $priceTotal 0;
  62.     public function __construct()
  63.     {
  64.         $this->items = new ArrayCollection();
  65.     }
  66.     /**
  67.      * {@inheritdoc}
  68.      */
  69.     public function getId(): ?string
  70.     {
  71.         return $this->id;
  72.     }
  73.     /**
  74.      * {@inheritdoc}
  75.      */
  76.     public function addItem(OrderItemInterface $item): void
  77.     {
  78.         $this->items->add($item);
  79.     }
  80.     /**
  81.      * {@inheritdoc}
  82.      */
  83.     public function removeItem(OrderItemInterface $item): void
  84.     {
  85.         $this->items->removeElement($item);
  86.     }
  87.     /**
  88.      * {@inheritdoc}
  89.      */
  90.     public function getItems(): Collection
  91.     {
  92.         return $this->items;
  93.     }
  94.     /**
  95.      * {@inheritdoc}
  96.      */
  97.     public function getPayment(): ?PaymentInterface
  98.     {
  99.         return $this->payment;
  100.     }
  101.     /**
  102.      * {@inheritdoc}
  103.      */
  104.     public function setPayment(PaymentInterface $payment): void
  105.     {
  106.         $this->payment $payment;
  107.     }
  108.     /**
  109.      * {@inheritdoc}
  110.      */
  111.     public function getShipment(): ?ShipmentInterface
  112.     {
  113.         return $this->shipment;
  114.     }
  115.     /**
  116.      * {@inheritdoc}
  117.      */
  118.     public function setShipment(ShipmentInterface $shipment): void
  119.     {
  120.         $this->shipment $shipment;
  121.     }
  122.     /**
  123.      * @param mixed $user
  124.      */
  125.     public function setUserId($user): void
  126.     {
  127.         $this->user $user;
  128.     }
  129.     /**
  130.      * {@inheritdoc}
  131.      */
  132.     public function getDiscount(): ?DiscountInterface
  133.     {
  134.         return $this->discount;
  135.     }
  136.     /**
  137.      * {@inheritdoc}
  138.      */
  139.     public function setDiscount(DiscountInterface $discount): void
  140.     {
  141.         $this->discount $discount;
  142.     }
  143.     /**
  144.      * {@inheritdoc}
  145.      */
  146.     public function getItemsTotal(): int
  147.     {
  148.         return $this->itemsTotal;
  149.     }
  150.     /**
  151.      * {@inheritdoc}
  152.      */
  153.     public function getUserId(): int
  154.     {
  155.         return $this->user;
  156.     }
  157.     /**
  158.      * {@inheritdoc}
  159.      */
  160.     public function setItemsTotal(int $itemsTotal): void
  161.     {
  162.         $this->itemsTotal $itemsTotal;
  163.     }
  164.     /**
  165.      * {@inheritdoc}
  166.      */
  167.     public function getPriceTotal(): float
  168.     {
  169.         return $this->priceTotal;
  170.     }
  171.     /**
  172.      * {@inheritdoc}
  173.      */
  174.     public function setPriceTotal(float $priceTotal): void
  175.     {
  176.         $this->priceTotal $priceTotal;
  177.     }
  178.     /**
  179.      * @return float
  180.      */
  181.     public function getItemsPriceTotal(): float
  182.     {
  183.         return $this->itemsPriceTotal;
  184.     }
  185.     /**
  186.      * @param float $itemsPriceTotal
  187.      */
  188.     public function setItemsPriceTotal(float $itemsPriceTotal): void
  189.     {
  190.         $this->itemsPriceTotal $itemsPriceTotal;
  191.     }
  192.         
  193.      /**
  194.      * {@inheritdoc}
  195.      */
  196.     public function getStatus()
  197.     {
  198.         return $this->status;
  199.     }
  200.     /**
  201.      * {@inheritdoc}
  202.      */
  203.     public function setStatus(int $status): void
  204.     {
  205.         $this->status $status;
  206.     }
  207.     
  208.      /**
  209.      * {@inheritdoc}
  210.      */
  211.     public function getCart_cat()
  212.     {
  213.         return $this->cart_cat;
  214.     }
  215.     /**
  216.      * {@inheritdoc}
  217.      */
  218.     public function setCart_cat(int $cart_cat): void
  219.     {
  220.         $this->cart_cat $cart_cat;
  221.     }
  222. }