src/Entity/Command.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CommandRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=CommandRepository::class)
  9.  */
  10. class Command
  11. {
  12.     /**
  13.      * @ORM\Id()
  14.      * @ORM\GeneratedValue()
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="float")
  20.      */
  21.     private $totalAmount;
  22.     /**
  23.      * @ORM\OneToMany(targetEntity=CommandProduct::class, mappedBy="command")
  24.      */
  25.     private $commandProducts;
  26.     /**
  27.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="commands")
  28.      */
  29.     private $client;
  30.     /**
  31.      * @ORM\Column(type="string", nullable=true)
  32.      */
  33.     private $chargeId;
  34.     /**
  35.      * @ORM\Column(type="string", length=255, nullable=true)
  36.      */
  37.     private $status;
  38.     /**
  39.      * @ORM\Column(type="string", length=255, nullable=true)
  40.      */
  41.     private $commandNumber;
  42.     /**
  43.      * @ORM\Column(type="string", length=255, nullable=true)
  44.      */
  45.     private $relaypoint;
  46.     /**
  47.      * @ORM\Column(type="string", length=255, nullable=true)
  48.      */
  49.     private $paymentType;
  50.     /**
  51.      * @ORM\Column(type="datetime", nullable=true)
  52.      */
  53.     private $createdAt;
  54.     /**
  55.      * @ORM\Column(type="datetime", nullable=true)
  56.      */
  57.     private $lastPayAt;
  58.     /**
  59.      * @ORM\OneToMany(targetEntity=CommandPack::class, mappedBy="command", fetch="EAGER")
  60.      */
  61.     private $commandPacks;
  62.     /**
  63.      * @ORM\Column(type="boolean", nullable=true)
  64.      */
  65.     private $isAvis;
  66.     /**
  67.      * @ORM\OneToMany(targetEntity=Transfert::class, mappedBy="command")
  68.      */
  69.     private $transferts;
  70.     /**
  71.      * @ORM\OneToMany(targetEntity=AppFee::class, mappedBy="command")
  72.      */
  73.     private $appFees;
  74.     /**
  75.      * @ORM\Column(type="float", nullable=true)
  76.      */
  77.     private $totalFraisLivraison;
  78.     public function __construct()
  79.     {
  80.         $this->commandProducts = new ArrayCollection();
  81.         $this->createdAt = new \DateTime();
  82.         $this->commandPacks = new ArrayCollection();
  83.         $this->transferts = new ArrayCollection();
  84.         $this->appFees = new ArrayCollection();
  85.     }
  86.     public function getId(): ?int
  87.     {
  88.         return $this->id;
  89.     }
  90.     public function getTotalAmount(): ?float
  91.     {
  92.         return $this->totalAmount;
  93.     }
  94.     public function setTotalAmount(float $totalAmount): self
  95.     {
  96.         $this->totalAmount $totalAmount;
  97.         return $this;
  98.     }
  99.     /**
  100.      * @return Collection|CommandProduct[]
  101.      */
  102.     public function getCommandProducts(): Collection
  103.     {
  104.         return $this->commandProducts;
  105.     }
  106.     public function addCommandProduct(CommandProduct $commandProduct): self
  107.     {
  108.         if (!$this->commandProducts->contains($commandProduct)) {
  109.             $this->commandProducts[] = $commandProduct;
  110.             $commandProduct->setCommand($this);
  111.         }
  112.         return $this;
  113.     }
  114.     public function removeCommandProduct(CommandProduct $commandProduct): self
  115.     {
  116.         if ($this->commandProducts->contains($commandProduct)) {
  117.             $this->commandProducts->removeElement($commandProduct);
  118.             // set the owning side to null (unless already changed)
  119.             if ($commandProduct->getCommand() === $this) {
  120.                 $commandProduct->setCommand(null);
  121.             }
  122.         }
  123.         return $this;
  124.     }
  125.     public function getClient(): ?User
  126.     {
  127.         return $this->client;
  128.     }
  129.     public function setClient(?User $client): self
  130.     {
  131.         $this->client $client;
  132.         return $this;
  133.     }
  134.     public function getChargeId(): ?string
  135.     {
  136.         return $this->chargeId;
  137.     }
  138.     public function setChargeId(?string $chargeId): self
  139.     {
  140.         $this->chargeId $chargeId;
  141.         return $this;
  142.     }
  143.     public function getStatus(): ?string
  144.     {
  145.         return $this->status;
  146.     }
  147.     public function getRelaypoint(): ?string
  148.     {
  149.         return $this->relaypoint;
  150.     }
  151.     public function setRelaypoint(?string $relaypoint): self
  152.     {
  153.         $this->relaypoint $relaypoint;
  154.         return $this;
  155.     }
  156.     public function setStatus(?string $status): self
  157.     {
  158.         $this->status $status;
  159.         return $this;
  160.     }
  161.     public function getCommandNumber(): ?string
  162.     {
  163.         return $this->commandNumber;
  164.     }
  165.     public function setCommandNumber(?string $commandNumber): self
  166.     {
  167.         $this->commandNumber $commandNumber;
  168.         return $this;
  169.     }
  170.     public function getPaymentType(): ?string
  171.     {
  172.         return $this->paymentType;
  173.     }
  174.     public function setPaymentType(?string $paymentType): self
  175.     {
  176.         $this->paymentType $paymentType;
  177.         return $this;
  178.     }
  179.     public function getCreatedAt(): ?\DateTimeInterface
  180.     {
  181.         return $this->createdAt;
  182.     }
  183.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  184.     {
  185.         $this->createdAt $createdAt;
  186.         return $this;
  187.     }
  188.     public function getLastPayAt(): ?\DateTimeInterface
  189.     {
  190.         return $this->lastPayAt;
  191.     }
  192.     public function setLastPayAt(?\DateTimeInterface $lastPayAt): self
  193.     {
  194.         $this->lastPayAt $lastPayAt;
  195.         return $this;
  196.     }
  197.     /**
  198.      * @return Collection|CommandPack[]
  199.      */
  200.     public function getCommandPacks(): Collection
  201.     {
  202.         return $this->commandPacks;
  203.     }
  204.     public function addCommandPack(CommandPack $commandPack): self
  205.     {
  206.         if (!$this->commandPacks->contains($commandPack)) {
  207.             $this->commandPacks[] = $commandPack;
  208.             $commandPack->setCommand($this);
  209.         }
  210.         return $this;
  211.     }
  212.     public function removeCommandPack(CommandPack $commandPack): self
  213.     {
  214.         if ($this->commandPacks->contains($commandPack)) {
  215.             $this->commandPacks->removeElement($commandPack);
  216.             // set the owning side to null (unless already changed)
  217.             if ($commandPack->getCommand() === $this) {
  218.                 $commandPack->setCommand(null);
  219.             }
  220.         }
  221.         return $this;
  222.     }
  223.     public function getIsAvis(): ?bool
  224.     {
  225.         return $this->isAvis;
  226.     }
  227.     public function setIsAvis(?bool $isAvis): self
  228.     {
  229.         $this->isAvis $isAvis;
  230.         return $this;
  231.     }
  232.     /**
  233.      * @return Collection<int, Transfert>
  234.      */
  235.     public function getTransferts(): Collection
  236.     {
  237.         return $this->transferts;
  238.     }
  239.     public function addTransfert(Transfert $transfert): self
  240.     {
  241.         if (!$this->transferts->contains($transfert)) {
  242.             $this->transferts[] = $transfert;
  243.             $transfert->setCommand($this);
  244.         }
  245.         return $this;
  246.     }
  247.     public function removeTransfert(Transfert $transfert): self
  248.     {
  249.         if ($this->transferts->removeElement($transfert)) {
  250.             // set the owning side to null (unless already changed)
  251.             if ($transfert->getCommand() === $this) {
  252.                 $transfert->setCommand(null);
  253.             }
  254.         }
  255.         return $this;
  256.     }
  257.     /**
  258.      * @return Collection<int, AppFee>
  259.      */
  260.     public function getAppFees(): Collection
  261.     {
  262.         return $this->appFees;
  263.     }
  264.     public function addAppFee(AppFee $appFee): self
  265.     {
  266.         if (!$this->appFees->contains($appFee)) {
  267.             $this->appFees[] = $appFee;
  268.             $appFee->setCommand($this);
  269.         }
  270.         return $this;
  271.     }
  272.     public function removeAppFee(AppFee $appFee): self
  273.     {
  274.         if ($this->appFees->removeElement($appFee)) {
  275.             // set the owning side to null (unless already changed)
  276.             if ($appFee->getCommand() === $this) {
  277.                 $appFee->setCommand(null);
  278.             }
  279.         }
  280.         return $this;
  281.     }
  282.     public function getTotalFraisLivraison(): ?float
  283.     {
  284.         return $this->totalFraisLivraison;
  285.     }
  286.     public function setTotalFraisLivraison(?float $totalFraisLivraison): self
  287.     {
  288.         $this->totalFraisLivraison $totalFraisLivraison;
  289.         return $this;
  290.     }
  291. }