src/Entity/Orders.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\OrdersRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassOrdersRepository::class)]
  8. class Orders
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\ManyToOne(targetEntityClinics::class, inversedBy'orders')]
  15.     private $clinic;
  16.     #[ORM\ManyToOne(targetEntityAddresses::class, inversedBy'orders')]
  17.     private $address;
  18.     #[ORM\Column(type'float'nullabletrue)]
  19.     private $deliveryFee;
  20.     #[ORM\Column(type'float')]
  21.     private $subTotal;
  22.     #[ORM\Column(type'float')]
  23.     private $tax;
  24.     #[ORM\Column(type'float')]
  25.     private $total;
  26.     #[ORM\Column(type'string'length255)]
  27.     private $status;
  28.     #[ORM\Column(type'datetime')]
  29.     private $modified;
  30.     #[ORM\Column(type'datetime')]
  31.     private $created;
  32.     #[ORM\OneToMany(targetEntityEventLog::class, mappedBy'orders')]
  33.     private $eventLogs;
  34.     #[ORM\OneToMany(targetEntityOrderItems::class, mappedBy'orders')]
  35.     private $orderItems;
  36.     #[ORM\Column(type'text'nullabletrue)]
  37.     private $notes;
  38.     #[ORM\Column(type'string'length255)]
  39.     private $email;
  40.     #[ORM\OneToOne(targetEntityBaskets::class, inversedBy'orders'cascade: ['persist''remove'])]
  41.     #[ORM\JoinColumn(nullablefalse)]
  42.     private $basket;
  43.     #[ORM\ManyToOne(targetEntityAddresses::class, inversedBy'billingAddress')]
  44.     private $billingAddress;
  45.     #[ORM\OneToMany(targetEntityChatParticipants::class, mappedBy'orders')]
  46.     private $distributor;
  47.     #[ORM\OneToMany(targetEntityChatMessages::class, mappedBy'orders')]
  48.     private $chatMessages;
  49.     #[ORM\OneToMany(targetEntityNotifications::class, mappedBy'orders')]
  50.     private $notifications;
  51.     #[ORM\OneToMany(targetEntityOrderStatus::class, mappedBy'orders')]
  52.     private $orderStatuses;
  53.     #[ORM\OneToMany(targetEntityControlledDrugFiles::class, mappedBy'orders')]
  54.     private $controlledDrugFiles;
  55.     public function __construct()
  56.     {
  57.         $this->setCreated(new \DateTime());
  58.         if ($this->getModified() == null) {
  59.             $this->setModified(new \DateTime());
  60.         }
  61.         $this->eventLogs = new ArrayCollection();
  62.         $this->orderItems = new ArrayCollection();
  63.         $this->distributor = new ArrayCollection();
  64.         $this->chatMessages = new ArrayCollection();
  65.         $this->notifications = new ArrayCollection();
  66.         $this->orderStatuses = new ArrayCollection();
  67.         $this->controlledDrugFiles = new ArrayCollection();
  68.     }
  69.     public function getId(): ?int
  70.     {
  71.         return $this->id;
  72.     }
  73.     public function getClinic(): ?Clinics
  74.     {
  75.         return $this->clinic;
  76.     }
  77.     public function setClinic(?Clinics $clinic): self
  78.     {
  79.         $this->clinic $clinic;
  80.         return $this;
  81.     }
  82.     public function getAddress(): ?Addresses
  83.     {
  84.         return $this->address;
  85.     }
  86.     public function setAddress(?Addresses $address): self
  87.     {
  88.         $this->address $address;
  89.         return $this;
  90.     }
  91.     public function getDeliveryFee(): ?float
  92.     {
  93.         return $this->deliveryFee;
  94.     }
  95.     public function setDeliveryFee(?float $deliveryFee): self
  96.     {
  97.         $this->deliveryFee $deliveryFee;
  98.         return $this;
  99.     }
  100.     public function getSubTotal(): ?float
  101.     {
  102.         return $this->subTotal;
  103.     }
  104.     public function setSubTotal(float $subTotal): self
  105.     {
  106.         $this->subTotal $subTotal;
  107.         return $this;
  108.     }
  109.     public function getTax(): ?float
  110.     {
  111.         return $this->tax;
  112.     }
  113.     public function setTax(float $tax): self
  114.     {
  115.         $this->tax $tax;
  116.         return $this;
  117.     }
  118.     public function getTotal(): ?float
  119.     {
  120.         return $this->total;
  121.     }
  122.     public function setTotal(float $total): self
  123.     {
  124.         $this->total $total;
  125.         return $this;
  126.     }
  127.     public function getStatus(): ?string
  128.     {
  129.         return $this->status;
  130.     }
  131.     public function setStatus(string $status): self
  132.     {
  133.         $this->status $status;
  134.         return $this;
  135.     }
  136.     public function getModified(): ?\DateTimeInterface
  137.     {
  138.         return $this->modified;
  139.     }
  140.     public function setModified(\DateTimeInterface $modified): self
  141.     {
  142.         $this->modified $modified;
  143.         return $this;
  144.     }
  145.     public function getCreated(): ?\DateTimeInterface
  146.     {
  147.         return $this->created;
  148.     }
  149.     public function setCreated(\DateTimeInterface $created): self
  150.     {
  151.         $this->created $created;
  152.         return $this;
  153.     }
  154.     /**
  155.      * @return Collection|EventLog[]
  156.      */
  157.     public function getEventLogs(): Collection
  158.     {
  159.         return $this->eventLogs;
  160.     }
  161.     public function addEventLog(EventLog $eventLog): self
  162.     {
  163.         if (!$this->eventLogs->contains($eventLog)) {
  164.             $this->eventLogs[] = $eventLog;
  165.             $eventLog->setOrders($this);
  166.         }
  167.         return $this;
  168.     }
  169.     public function removeEventLog(EventLog $eventLog): self
  170.     {
  171.         if ($this->eventLogs->removeElement($eventLog)) {
  172.             // set the owning side to null (unless already changed)
  173.             if ($eventLog->getOrders() === $this) {
  174.                 $eventLog->setOrders(null);
  175.             }
  176.         }
  177.         return $this;
  178.     }
  179.     /**
  180.      * @return Collection|OrderItems[]
  181.      */
  182.     public function getOrderItems(): Collection
  183.     {
  184.         return $this->orderItems;
  185.     }
  186.     public function addOrderItem(OrderItems $orderItem): self
  187.     {
  188.         if (!$this->orderItems->contains($orderItem)) {
  189.             $this->orderItems[] = $orderItem;
  190.             $orderItem->setOrders($this);
  191.         }
  192.         return $this;
  193.     }
  194.     public function removeOrderItem(OrderItems $orderItem): self
  195.     {
  196.         if ($this->orderItems->removeElement($orderItem)) {
  197.             // set the owning side to null (unless already changed)
  198.             if ($orderItem->getOrders() === $this) {
  199.                 $orderItem->setOrders(null);
  200.             }
  201.         }
  202.         return $this;
  203.     }
  204.     public function getNotes(): ?string
  205.     {
  206.         return $this->notes;
  207.     }
  208.     public function setNotes(?string $notes): self
  209.     {
  210.         $this->notes $notes;
  211.         return $this;
  212.     }
  213.     public function getEmail(): ?string
  214.     {
  215.         return $this->email;
  216.     }
  217.     public function setEmail(string $email): self
  218.     {
  219.         $this->email $email;
  220.         return $this;
  221.     }
  222.     public function getBasket(): ?Baskets
  223.     {
  224.         return $this->basket;
  225.     }
  226.     public function setBasket(Baskets $basket): self
  227.     {
  228.         $this->basket $basket;
  229.         return $this;
  230.     }
  231.     public function getBillingAddress(): ?Addresses
  232.     {
  233.         return $this->billingAddress;
  234.     }
  235.     public function setBillingAddress(?Addresses $billingAddress): self
  236.     {
  237.         $this->billingAddress $billingAddress;
  238.         return $this;
  239.     }
  240.     /**
  241.      * @return Collection<int, ChatParticipants>
  242.      */
  243.     public function getDistributor(): Collection
  244.     {
  245.         return $this->distributor;
  246.     }
  247.     public function addDistributor(ChatParticipants $distributor): self
  248.     {
  249.         if (!$this->distributor->contains($distributor)) {
  250.             $this->distributor[] = $distributor;
  251.             $distributor->setOrders($this);
  252.         }
  253.         return $this;
  254.     }
  255.     public function removeDistributor(ChatParticipants $distributor): self
  256.     {
  257.         if ($this->distributor->removeElement($distributor)) {
  258.             // set the owning side to null (unless already changed)
  259.             if ($distributor->getOrders() === $this) {
  260.                 $distributor->setOrders(null);
  261.             }
  262.         }
  263.         return $this;
  264.     }
  265.     /**
  266.      * @return Collection<int, ChatMessages>
  267.      */
  268.     public function getChatMessages(): Collection
  269.     {
  270.         return $this->chatMessages;
  271.     }
  272.     public function addChatMessage(ChatMessages $chatMessage): self
  273.     {
  274.         if (!$this->chatMessages->contains($chatMessage)) {
  275.             $this->chatMessages[] = $chatMessage;
  276.             $chatMessage->setOrders($this);
  277.         }
  278.         return $this;
  279.     }
  280.     public function removeChatMessage(ChatMessages $chatMessage): self
  281.     {
  282.         if ($this->chatMessages->removeElement($chatMessage)) {
  283.             // set the owning side to null (unless already changed)
  284.             if ($chatMessage->getOrders() === $this) {
  285.                 $chatMessage->setOrders(null);
  286.             }
  287.         }
  288.         return $this;
  289.     }
  290.     /**
  291.      * @return Collection<int, Notifications>
  292.      */
  293.     public function getNotifications(): Collection
  294.     {
  295.         return $this->notifications;
  296.     }
  297.     public function addNotification(Notifications $notification): self
  298.     {
  299.         if (!$this->notifications->contains($notification)) {
  300.             $this->notifications[] = $notification;
  301.             $notification->setOrdersId($this);
  302.         }
  303.         return $this;
  304.     }
  305.     public function removeNotification(Notifications $notification): self
  306.     {
  307.         if ($this->notifications->removeElement($notification)) {
  308.             // set the owning side to null (unless already changed)
  309.             if ($notification->getOrdersId() === $this) {
  310.                 $notification->setOrdersId(null);
  311.             }
  312.         }
  313.         return $this;
  314.     }
  315.     /**
  316.      * @return Collection<int, OrderStatus>
  317.      */
  318.     public function getOrderStatuses(): Collection
  319.     {
  320.         return $this->orderStatuses;
  321.     }
  322.     public function addOrderStatus(OrderStatus $orderStatus): self
  323.     {
  324.         if (!$this->orderStatuses->contains($orderStatus)) {
  325.             $this->orderStatuses[] = $orderStatus;
  326.             $orderStatus->setOrders($this);
  327.         }
  328.         return $this;
  329.     }
  330.     public function removeOrderStatus(OrderStatus $orderStatus): self
  331.     {
  332.         if ($this->orderStatuses->removeElement($orderStatus)) {
  333.             // set the owning side to null (unless already changed)
  334.             if ($orderStatus->getOrders() === $this) {
  335.                 $orderStatus->setOrders(null);
  336.             }
  337.         }
  338.         return $this;
  339.     }
  340.     /**
  341.      * @return Collection<int, ControlledDrugFiles>
  342.      */
  343.     public function getControlledDrugFiles(): Collection
  344.     {
  345.         return $this->controlledDrugFiles;
  346.     }
  347.     public function addControlledDrugFile(ControlledDrugFiles $controlledDrugFile): self
  348.     {
  349.         if (!$this->controlledDrugFiles->contains($controlledDrugFile)) {
  350.             $this->controlledDrugFiles[] = $controlledDrugFile;
  351.             $controlledDrugFile->setOrders($this);
  352.         }
  353.         return $this;
  354.     }
  355.     public function removeControlledDrugFile(ControlledDrugFiles $controlledDrugFile): self
  356.     {
  357.         if ($this->controlledDrugFiles->removeElement($controlledDrugFile)) {
  358.             // set the owning side to null (unless already changed)
  359.             if ($controlledDrugFile->getOrders() === $this) {
  360.                 $controlledDrugFile->setOrders(null);
  361.             }
  362.         }
  363.         return $this;
  364.     }
  365. }