src/Entity/ShoppingCart.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ShoppingCartRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=ShoppingCartRepository::class)
  9.  */
  10. class ShoppingCart
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="shoppingCarts")
  20.      */
  21.     private $idUser;
  22.     /**
  23.      * @ORM\Column(type="decimal", precision=10, scale=0, nullable=true)
  24.      */
  25.     private $totalPriceTTC;
  26.     /**
  27.      * @ORM\ManyToMany(targetEntity=PackageCompagny::class, inversedBy="shoppingCarts")
  28.      */
  29.     private $collectionPackages;
  30.     /**
  31.      * @ORM\Column(type="string", length=255, nullable=true)
  32.      */
  33.     private $statut;
  34.     /**
  35.      * @ORM\ManyToOne(targetEntity=CompagnyInfo::class, inversedBy="shoppingCarts")
  36.      */
  37.     private $idCompagny;
  38.     /**
  39.      * @ORM\Column(type="array", nullable=true)
  40.      */
  41.     private $quantityArray = [];
  42.     /**
  43.      * @ORM\Column(type="date", nullable=true)
  44.      */
  45.     private $reservationDate;
  46.     /**
  47.      * @ORM\Column(type="date", nullable=true)
  48.      */
  49.     private $reservationDateOld;
  50.     /**
  51.      * @ORM\OneToOne(targetEntity=Estimate::class, mappedBy="idCart")
  52.      */
  53.     private $estimate;
  54.     /**
  55.      * @ORM\Column(type="decimal", precision=10, scale=0, nullable=true)
  56.      */
  57.     private $accountPricePayed;
  58.     /**
  59.      * @ORM\Column(type="decimal", precision=10, scale=0, nullable=true)
  60.      */
  61.     private $totalPriceHT;
  62.     /**
  63.      * @ORM\Column(type="text", nullable=true)
  64.      */
  65.     private $comment;
  66.     /**
  67.      * @ORM\Column(type="decimal", precision=10, scale=2, options={"default" : 0.00})
  68.      */
  69.     private $depositPaid;
  70.     /**
  71.      * @ORM\Column(type="decimal", precision=10, scale=2, options={"default" : 0.00})
  72.      */
  73.     private $outstandingBalance;
  74.     /**
  75.      * @ORM\Column(type="decimal", precision=10, scale=2, options={"default" : 0.00})
  76.      */
  77.     private $depositPaidHT;
  78.     /**
  79.      * @ORM\Column(type="decimal", precision=10, scale=2, options={"default" : 0.00})
  80.      */
  81.     private $outstandingBalanceHT;
  82.     /**
  83.      * @ORM\Column(type="boolean", options={"default" : false})
  84.      */
  85.     private $checkDeposit;
  86.     /**
  87.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  88.      */
  89.     private $totalAmountFees;
  90.     /**
  91.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  92.      */
  93.     private $totalAmountDepositFees;
  94.     /**
  95.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  96.      */
  97.     private $totalAmountOutstandingFees;
  98.     /**
  99.      * @ORM\OneToMany(targetEntity=Billing::class, mappedBy="idCart", cascade={"persist"})
  100.      */
  101.     private $billing;
  102.     /**
  103.      * @ORM\OneToMany(targetEntity=FeesBilling::class, mappedBy="cartFees", cascade={"persist"})
  104.      */
  105.     private $feesBilling;
  106.     public function __construct()
  107.     {
  108.         $this->collectionPackages = new ArrayCollection();
  109.         $this->billing = new ArrayCollection();
  110.         $this->feesBilling = new ArrayCollection();
  111.     }
  112.     public function getId(): ?int
  113.     {
  114.         return $this->id;
  115.     }
  116.     public function getIdUser(): ?User
  117.     {
  118.         return $this->idUser;
  119.     }
  120.     public function setIdUser(?User $idUser): self
  121.     {
  122.         $this->idUser $idUser;
  123.         return $this;
  124.     }
  125.     public function getTotalPriceTTC(): ?string
  126.     {
  127.         return $this->totalPriceTTC;
  128.     }
  129.     public function setTotalPriceTTC(?string $totalPriceTTC): self
  130.     {
  131.         $this->totalPriceTTC $totalPriceTTC;
  132.         return $this;
  133.     }
  134.     /**
  135.      * @return Collection|PackageCompagny[]
  136.      */
  137.     public function getCollectionPackages(): Collection
  138.     {
  139.         return $this->collectionPackages;
  140.     }
  141.     public function addCollectionPackage(PackageCompagny $collectionPackage): self
  142.     {
  143.         if (!$this->collectionPackages->contains($collectionPackage)) {
  144.             $this->collectionPackages[] = $collectionPackage;
  145.         }
  146.         return $this;
  147.     }
  148.     public function removeCollectionPackage(PackageCompagny $collectionPackage): self
  149.     {
  150.         $this->collectionPackages->removeElement($collectionPackage);
  151.         return $this;
  152.     }
  153.     public function getStatut(): ?string
  154.     {
  155.         return $this->statut;
  156.     }
  157.     public function setStatut(?string $statut): self
  158.     {
  159.         $this->statut $statut;
  160.         return $this;
  161.     }
  162.     public function getIdCompagny(): ?CompagnyInfo
  163.     {
  164.         return $this->idCompagny;
  165.     }
  166.     public function setIdCompagny(?CompagnyInfo $idCompagny): self
  167.     {
  168.         $this->idCompagny $idCompagny;
  169.         return $this;
  170.     }
  171.     public function getQuantityArray(): ?array
  172.     {
  173.         return $this->quantityArray;
  174.     }
  175.     public function setQuantityArray(?array $quantityArray): self
  176.     {
  177.         $this->quantityArray $quantityArray;
  178.         return $this;
  179.     }
  180.     public function getReservationDate(): ?\DateTimeInterface
  181.     {
  182.         return $this->reservationDate;
  183.     }
  184.     public function setReservationDate(?\DateTimeInterface $reservationDate): self
  185.     {
  186.         $this->reservationDate $reservationDate;
  187.         return $this;
  188.     }
  189.     public function getReservationDateOld(): ?\DateTimeInterface
  190.     {
  191.         return $this->reservationDateOld;
  192.     }
  193.     public function setReservationDateOld(?\DateTimeInterface $reservationDateOld): self
  194.     {
  195.         $this->reservationDateOld $reservationDateOld;
  196.         return $this;
  197.     }
  198.     public function getEstimate(): ?Estimate
  199.     {
  200.         return $this->estimate;
  201.     }
  202.     public function setEstimate(?Estimate $estimate): self
  203.     {
  204.         // unset the owning side of the relation if necessary
  205.         if ($estimate === null && $this->estimate !== null) {
  206.             $this->estimate->setIdCart(null);
  207.         }
  208.         // set the owning side of the relation if necessary
  209.         if ($estimate !== null && $estimate->getIdCart() !== $this) {
  210.             $estimate->setIdCart($this);
  211.         }
  212.         $this->estimate $estimate;
  213.         return $this;
  214.     }
  215.     public function getAccountPricePayed(): ?string
  216.     {
  217.         return $this->accountPricePayed;
  218.     }
  219.     public function setAccountPricePayed(?string $accountPricePayed): self
  220.     {
  221.         $this->accountPricePayed $accountPricePayed;
  222.         return $this;
  223.     }
  224.     public function getTotalPriceHT(): ?string
  225.     {
  226.         return $this->totalPriceHT;
  227.     }
  228.     public function setTotalPriceHT(?string $totalPriceHT): self
  229.     {
  230.         $this->totalPriceHT $totalPriceHT;
  231.         return $this;
  232.     }
  233.     public function getComment(): ?string
  234.     {
  235.         return $this->comment;
  236.     }
  237.     public function setComment(?string $comment): self
  238.     {
  239.         $this->comment $comment;
  240.         return $this;
  241.     }
  242.     public function getDepositPaid(): ?string
  243.     {
  244.         return $this->depositPaid;
  245.     }
  246.     public function setDepositPaid(string $depositPaid): self
  247.     {
  248.         $this->depositPaid $depositPaid;
  249.         return $this;
  250.     }
  251.     public function getOutstandingBalance(): ?string
  252.     {
  253.         return $this->outstandingBalance;
  254.     }
  255.     public function setOutstandingBalance(string $outstandingBalance): self
  256.     {
  257.         $this->outstandingBalance $outstandingBalance;
  258.         return $this;
  259.     }
  260.     public function getDepositPaidHT(): ?string
  261.     {
  262.         return $this->depositPaidHT;
  263.     }
  264.     public function setDepositPaidHT(string $depositPaidHT): self
  265.     {
  266.         $this->depositPaidHT $depositPaidHT;
  267.         return $this;
  268.     }
  269.     public function getOutstandingBalanceHT(): ?string
  270.     {
  271.         return $this->outstandingBalanceHT;
  272.     }
  273.     public function setOutstandingBalanceHT(string $outstandingBalanceHT): self
  274.     {
  275.         $this->outstandingBalanceHT $outstandingBalanceHT;
  276.         return $this;
  277.     }
  278.     public function getCheckDeposit(): ?bool
  279.     {
  280.         return $this->checkDeposit;
  281.     }
  282.     public function setCheckDeposit(bool $checkDeposit): self
  283.     {
  284.         $this->checkDeposit $checkDeposit;
  285.         return $this;
  286.     }
  287.     public function getTotalAmountFees(): ?string
  288.     {
  289.         return $this->totalAmountFees;
  290.     }
  291.     public function setTotalAmountFees(?string $totalAmountFees): self
  292.     {
  293.         $this->totalAmountFees $totalAmountFees;
  294.         return $this;
  295.     }
  296.     public function getTotalAmountDepositFees(): ?string
  297.     {
  298.         return $this->totalAmountDepositFees;
  299.     }
  300.     public function setTotalAmountDepositFees(?string $totalAmountDepositFees): self
  301.     {
  302.         $this->totalAmountDepositFees $totalAmountDepositFees;
  303.         return $this;
  304.     }
  305.     public function getTotalAmountOutstandingFees(): ?string
  306.     {
  307.         return $this->totalAmountOutstandingFees;
  308.     }
  309.     public function setTotalAmountOutstandingFees(?string $totalAmountOutstandingFees): self
  310.     {
  311.         $this->totalAmountOutstandingFees $totalAmountOutstandingFees;
  312.         return $this;
  313.     }
  314.     /**
  315.      * @return Collection|Billing[]
  316.      */
  317.     public function getBilling(): Collection
  318.     {
  319.         return $this->billing;
  320.     }
  321.     public function addBilling(Billing $billing): self
  322.     {
  323.         if (!$this->billing->contains($billing)) {
  324.             $this->billing[] = $billing;
  325.             $billing->setShoppingCart($this);
  326.         }
  327.         return $this;
  328.     }
  329.     public function removeBilling(Billing $billing): self
  330.     {
  331.         if ($this->billing->removeElement($billing)) {
  332.             // set the owning side to null (unless already changed)
  333.             if ($billing->getShoppingCart() === $this) {
  334.                 $billing->setShoppingCart(null);
  335.             }
  336.         }
  337.         return $this;
  338.     }
  339.     /**
  340.      * @return Collection|FeesBilling[]
  341.      */
  342.     public function getFeesBilling(): Collection
  343.     {
  344.         return $this->feesBilling;
  345.     }
  346.     public function addFeesBilling(FeesBilling $feesBilling): self
  347.     {
  348.         if (!$this->feesBilling->contains($feesBilling)) {
  349.             $this->feesBilling[] = $feesBilling;
  350.             $feesBilling->setShoppingCart($this);
  351.         }
  352.         return $this;
  353.     }
  354.     public function removeFeesBilling(FeesBilling $feesBilling): self
  355.     {
  356.         if ($this->feesBilling->removeElement($feesBilling)) {
  357.             // set the owning side to null (unless already changed)
  358.             if ($feesBilling->getShoppingCart() === $this) {
  359.                 $feesBilling->setShoppingCart(null);
  360.             }
  361.         }
  362.         return $this;
  363.     }
  364. }