src/Entity/Command.php line 18

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