src/Entity/Orders.php line 13

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. /**
  8.  * @ORM\Entity(repositoryClass=OrdersRepository::class)
  9.  */
  10. class Orders
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="integer", nullable=true)
  20.      */
  21.     private $idPunch null;
  22.     /**
  23.      * @ORM\ManyToOne(targetEntity=Establishments::class, inversedBy="orders")
  24.      */
  25.     private $establishment;
  26.     /**
  27.      * @ORM\Column(type="text", nullable=true)
  28.      */
  29.     private $comment null;
  30.     /**
  31.      * @ORM\Column(type="boolean")
  32.      */
  33.     private $delivered false;
  34.     /**
  35.      * @ORM\Column(type="datetime")
  36.      */
  37.     private $createdAt;
  38.     /**
  39.      * @ORM\Column(type="datetime", nullable=true)
  40.      */
  41.     private $deliveryDate null;
  42.     /**
  43.      * @ORM\Column(type="boolean")
  44.      */
  45.     private $validated false;
  46.     /**
  47.      * @ORM\Column(type="datetime", nullable=true)
  48.      */
  49.     private $validatedAt null;
  50.     /**
  51.      * @ORM\ManyToOne(targetEntity=Users::class, inversedBy="ordersValidated")
  52.      */
  53.     private $validatedBy;
  54.     /**
  55.      * @ORM\ManyToOne(targetEntity=OrderStatus::class, inversedBy="orders")
  56.      */
  57.     private $status;
  58.     /**
  59.      * @ORM\OneToMany(targetEntity=OrderArticle::class, mappedBy="orderCart")
  60.      */
  61.     private $orderArticles;
  62.     /**
  63.      * @ORM\Column(type="boolean")
  64.      */
  65.     private $standard false;
  66.     /**
  67.      * @ORM\ManyToOne(targetEntity=Users::class, inversedBy="orders")
  68.      */
  69.     private $user;
  70.     /**
  71.      * @ORM\Column(type="datetime")
  72.      */
  73.     private $lastPickupUpdateAt;
  74.     /**
  75.      * @ORM\ManyToOne(targetEntity=Users::class, inversedBy="lastPickupUpdateOrder")
  76.      */
  77.     private $lastPickupUpdateBy;
  78.     /**
  79.      * @ORM\Column(type="boolean")
  80.      */
  81.     private $deleted false;
  82.     /**
  83.      * @ORM\OneToMany(targetEntity=Invoice::class, mappedBy="orderNumber")
  84.      */
  85.     private $invoices;
  86.     /**
  87.      * @ORM\OneToMany(targetEntity=ArticleOrderOutOfStock::class, mappedBy="orders")
  88.      */
  89.     private $articleOrderOutOfStocks;
  90.     /**
  91.      * @ORM\Column(type="boolean", nullable=true)
  92.      */
  93.     private $isRead false;
  94.     /**
  95.      * @ORM\Column(type="boolean", nullable=false)
  96.      */
  97.     private $fromApp true;
  98.     public function __construct()
  99.     {
  100.         $this->createdAt = New \DateTime();
  101.         $this->lastPickupUpdateAt = New \DateTime();
  102.         $this->orderArticles = new ArrayCollection();
  103.         $this->invoices = new ArrayCollection();
  104.         $this->articleOrderOutOfStocks = new ArrayCollection();
  105.     }
  106.     public function getId(): ?int
  107.     {
  108.         return $this->id;
  109.     }
  110.     public function getIdPunch(): ?int
  111.     {
  112.         return $this->idPunch;
  113.     }
  114.     public function setIdPunch(?int $idPunch): self
  115.     {
  116.         $this->idPunch $idPunch;
  117.         return $this;
  118.     }
  119.     public function getEstablishment(): ?Establishments
  120.     {
  121.         return $this->establishment;
  122.     }
  123.     public function setEstablishment(?Establishments $establishment): self
  124.     {
  125.         $this->establishment $establishment;
  126.         return $this;
  127.     }
  128.     public function getComment(): ?string
  129.     {
  130.         return $this->comment;
  131.     }
  132.     public function setComment(?string $comment): self
  133.     {
  134.         $this->comment $comment;
  135.         return $this;
  136.     }
  137.     public function isDelivered(): ?bool
  138.     {
  139.         return $this->delivered;
  140.     }
  141.     public function setDelivered(bool $delivered): self
  142.     {
  143.         $this->delivered $delivered;
  144.         return $this;
  145.     }
  146.     public function getCreatedAt(): ?\DateTimeInterface
  147.     {
  148.         return $this->createdAt;
  149.     }
  150.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  151.     {
  152.         $this->createdAt $createdAt;
  153.         return $this;
  154.     }
  155.     public function getDeliveryDate(): ?\DateTimeInterface
  156.     {
  157.         return $this->deliveryDate;
  158.     }
  159.     public function setDeliveryDate(?\DateTimeInterface $deliveryDate): self
  160.     {
  161.         $this->deliveryDate $deliveryDate;
  162.         return $this;
  163.     }
  164.     public function isValidated(): ?bool
  165.     {
  166.         return $this->validated;
  167.     }
  168.     public function setValidated(bool $validated): self
  169.     {
  170.         $this->validated $validated;
  171.         return $this;
  172.     }
  173.     public function getValidatedAt(): ?\DateTimeInterface
  174.     {
  175.         return $this->validatedAt;
  176.     }
  177.     public function setValidatedAt(?\DateTimeInterface $validatedAt): self
  178.     {
  179.         $this->validatedAt $validatedAt;
  180.         return $this;
  181.     }
  182.     public function getValidatedBy(): ?Users
  183.     {
  184.         return $this->validatedBy;
  185.     }
  186.     public function setValidatedBy(?Users $validatedBy): self
  187.     {
  188.         $this->validatedBy $validatedBy;
  189.         return $this;
  190.     }
  191.     public function getStatus(): ?OrderStatus
  192.     {
  193.         return $this->status;
  194.     }
  195.     public function setStatus(?OrderStatus $status): self
  196.     {
  197.         $this->status $status;
  198.         return $this;
  199.     }
  200.     /**
  201.      * @return Collection<int, OrderArticle>
  202.      */
  203.     public function getOrderArticles(): Collection
  204.     {
  205.         return $this->orderArticles;
  206.     }
  207.     public function addOrderArticle(OrderArticle $orderArticle): self
  208.     {
  209.         if (!$this->orderArticles->contains($orderArticle)) {
  210.             $this->orderArticles[] = $orderArticle;
  211.             $orderArticle->setOrderCart($this);
  212.         }
  213.         return $this;
  214.     }
  215.     public function removeOrderArticle(OrderArticle $orderArticle): self
  216.     {
  217.         if ($this->orderArticles->removeElement($orderArticle)) {
  218.             // set the owning side to null (unless already changed)
  219.             if ($orderArticle->getOrderCart() === $this) {
  220.                 $orderArticle->setOrderCart(null);
  221.             }
  222.         }
  223.         return $this;
  224.     }
  225.     public function getStandard(): ?bool
  226.     {
  227.         return $this->standard;
  228.     }
  229.     public function setStandard(bool $standard): self
  230.     {
  231.         $this->standard $standard;
  232.         return $this;
  233.     }
  234.     public function getUser(): ?Users
  235.     {
  236.         return $this->user;
  237.     }
  238.     public function setUser(?Users $user): self
  239.     {
  240.         $this->user $user;
  241.         return $this;
  242.     }
  243.     public function getLastPickupUpdateAt(): ?\DateTimeInterface
  244.     {
  245.         return $this->lastPickupUpdateAt;
  246.     }
  247.     public function setLastPickupUpdateAt(\DateTimeInterface $lastPickupUpdateAt): self
  248.     {
  249.         $this->lastPickupUpdateAt $lastPickupUpdateAt;
  250.         return $this;
  251.     }
  252.     public function getLastPickupUpdateBy(): ?Users
  253.     {
  254.         return $this->lastPickupUpdateBy;
  255.     }
  256.     public function setLastPickupUpdateBy(?Users $lastPickupUpdateBy): self
  257.     {
  258.         $this->lastPickupUpdateBy $lastPickupUpdateBy;
  259.         return $this;
  260.     }
  261.     public function isDeleted(): ?bool
  262.     {
  263.         return $this->deleted;
  264.     }
  265.     public function setDeleted(bool $deleted): self
  266.     {
  267.         $this->deleted $deleted;
  268.         return $this;
  269.     }
  270.     /**
  271.      * @return Collection<int, Invoice>
  272.      */
  273.     public function getInvoices(): Collection
  274.     {
  275.         return $this->invoices;
  276.     }
  277.     public function addInvoice(Invoice $invoice): self
  278.     {
  279.         if (!$this->invoices->contains($invoice)) {
  280.             $this->invoices[] = $invoice;
  281.             $invoice->setOrderNumber($this);
  282.         }
  283.         return $this;
  284.     }
  285.     public function removeInvoice(Invoice $invoice): self
  286.     {
  287.         if ($this->invoices->removeElement($invoice)) {
  288.             // set the owning side to null (unless already changed)
  289.             if ($invoice->getOrderNumber() === $this) {
  290.                 $invoice->setOrderNumber(null);
  291.             }
  292.         }
  293.         return $this;
  294.     }
  295.     /**
  296.      * @return Collection<int, ArticleOrderOutOfStock>
  297.      */
  298.     public function getArticleOrderOutOfStocks(): Collection
  299.     {
  300.         return $this->articleOrderOutOfStocks;
  301.     }
  302.     public function addArticleOrderOutOfStock(ArticleOrderOutOfStock $articleOrderOutOfStock): self
  303.     {
  304.         if (!$this->articleOrderOutOfStocks->contains($articleOrderOutOfStock)) {
  305.             $this->articleOrderOutOfStocks[] = $articleOrderOutOfStock;
  306.             $articleOrderOutOfStock->setOrder($this);
  307.         }
  308.         return $this;
  309.     }
  310.     public function removeArticleOrderOutOfStock(ArticleOrderOutOfStock $articleOrderOutOfStock): self
  311.     {
  312.         if ($this->articleOrderOutOfStocks->removeElement($articleOrderOutOfStock)) {
  313.             // set the owning side to null (unless already changed)
  314.             if ($articleOrderOutOfStock->getOrder() === $this) {
  315.                 $articleOrderOutOfStock->setOrder(null);
  316.             }
  317.         }
  318.         return $this;
  319.     }
  320.     public function isIsRead(): ?bool
  321.     {
  322.         return $this->isRead;
  323.     }
  324.     public function setIsRead(?bool $isRead): self
  325.     {
  326.         $this->isRead $isRead;
  327.         return $this;
  328.     }
  329.     public function isFromApp(): ?bool
  330.     {
  331.         return $this->fromApp;
  332.     }
  333.     public function setFromApp(?bool $fromApp): self
  334.     {
  335.         $this->fromApp $fromApp;
  336.         return $this;
  337.     }
  338. }