<?php
namespace App\Entity;
use App\Repository\ShoppingCartRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=ShoppingCartRepository::class)
*/
class ShoppingCart
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="shoppingCarts")
*/
private $idUser;
/**
* @ORM\Column(type="decimal", precision=10, scale=0, nullable=true)
*/
private $totalPriceTTC;
/**
* @ORM\ManyToMany(targetEntity=PackageCompagny::class, inversedBy="shoppingCarts")
*/
private $collectionPackages;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $statut;
/**
* @ORM\ManyToOne(targetEntity=CompagnyInfo::class, inversedBy="shoppingCarts")
*/
private $idCompagny;
/**
* @ORM\Column(type="array", nullable=true)
*/
private $quantityArray = [];
/**
* @ORM\Column(type="date", nullable=true)
*/
private $reservationDate;
/**
* @ORM\Column(type="date", nullable=true)
*/
private $reservationDateOld;
/**
* @ORM\OneToOne(targetEntity=Estimate::class, mappedBy="idCart")
*/
private $estimate;
/**
* @ORM\Column(type="decimal", precision=10, scale=0, nullable=true)
*/
private $accountPricePayed;
/**
* @ORM\Column(type="decimal", precision=10, scale=0, nullable=true)
*/
private $totalPriceHT;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $comment;
/**
* @ORM\Column(type="decimal", precision=10, scale=2, options={"default" : 0.00})
*/
private $depositPaid;
/**
* @ORM\Column(type="decimal", precision=10, scale=2, options={"default" : 0.00})
*/
private $outstandingBalance;
/**
* @ORM\Column(type="decimal", precision=10, scale=2, options={"default" : 0.00})
*/
private $depositPaidHT;
/**
* @ORM\Column(type="decimal", precision=10, scale=2, options={"default" : 0.00})
*/
private $outstandingBalanceHT;
/**
* @ORM\Column(type="boolean", options={"default" : false})
*/
private $checkDeposit;
/**
* @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
*/
private $totalAmountFees;
/**
* @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
*/
private $totalAmountDepositFees;
/**
* @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
*/
private $totalAmountOutstandingFees;
/**
* @ORM\OneToMany(targetEntity=Billing::class, mappedBy="idCart", cascade={"persist"})
*/
private $billing;
/**
* @ORM\OneToMany(targetEntity=FeesBilling::class, mappedBy="cartFees", cascade={"persist"})
*/
private $feesBilling;
public function __construct()
{
$this->collectionPackages = new ArrayCollection();
$this->billing = new ArrayCollection();
$this->feesBilling = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getIdUser(): ?User
{
return $this->idUser;
}
public function setIdUser(?User $idUser): self
{
$this->idUser = $idUser;
return $this;
}
public function getTotalPriceTTC(): ?string
{
return $this->totalPriceTTC;
}
public function setTotalPriceTTC(?string $totalPriceTTC): self
{
$this->totalPriceTTC = $totalPriceTTC;
return $this;
}
/**
* @return Collection|PackageCompagny[]
*/
public function getCollectionPackages(): Collection
{
return $this->collectionPackages;
}
public function addCollectionPackage(PackageCompagny $collectionPackage): self
{
if (!$this->collectionPackages->contains($collectionPackage)) {
$this->collectionPackages[] = $collectionPackage;
}
return $this;
}
public function removeCollectionPackage(PackageCompagny $collectionPackage): self
{
$this->collectionPackages->removeElement($collectionPackage);
return $this;
}
public function getStatut(): ?string
{
return $this->statut;
}
public function setStatut(?string $statut): self
{
$this->statut = $statut;
return $this;
}
public function getIdCompagny(): ?CompagnyInfo
{
return $this->idCompagny;
}
public function setIdCompagny(?CompagnyInfo $idCompagny): self
{
$this->idCompagny = $idCompagny;
return $this;
}
public function getQuantityArray(): ?array
{
return $this->quantityArray;
}
public function setQuantityArray(?array $quantityArray): self
{
$this->quantityArray = $quantityArray;
return $this;
}
public function getReservationDate(): ?\DateTimeInterface
{
return $this->reservationDate;
}
public function setReservationDate(?\DateTimeInterface $reservationDate): self
{
$this->reservationDate = $reservationDate;
return $this;
}
public function getReservationDateOld(): ?\DateTimeInterface
{
return $this->reservationDateOld;
}
public function setReservationDateOld(?\DateTimeInterface $reservationDateOld): self
{
$this->reservationDateOld = $reservationDateOld;
return $this;
}
public function getEstimate(): ?Estimate
{
return $this->estimate;
}
public function setEstimate(?Estimate $estimate): self
{
// unset the owning side of the relation if necessary
if ($estimate === null && $this->estimate !== null) {
$this->estimate->setIdCart(null);
}
// set the owning side of the relation if necessary
if ($estimate !== null && $estimate->getIdCart() !== $this) {
$estimate->setIdCart($this);
}
$this->estimate = $estimate;
return $this;
}
public function getAccountPricePayed(): ?string
{
return $this->accountPricePayed;
}
public function setAccountPricePayed(?string $accountPricePayed): self
{
$this->accountPricePayed = $accountPricePayed;
return $this;
}
public function getTotalPriceHT(): ?string
{
return $this->totalPriceHT;
}
public function setTotalPriceHT(?string $totalPriceHT): self
{
$this->totalPriceHT = $totalPriceHT;
return $this;
}
public function getComment(): ?string
{
return $this->comment;
}
public function setComment(?string $comment): self
{
$this->comment = $comment;
return $this;
}
public function getDepositPaid(): ?string
{
return $this->depositPaid;
}
public function setDepositPaid(string $depositPaid): self
{
$this->depositPaid = $depositPaid;
return $this;
}
public function getOutstandingBalance(): ?string
{
return $this->outstandingBalance;
}
public function setOutstandingBalance(string $outstandingBalance): self
{
$this->outstandingBalance = $outstandingBalance;
return $this;
}
public function getDepositPaidHT(): ?string
{
return $this->depositPaidHT;
}
public function setDepositPaidHT(string $depositPaidHT): self
{
$this->depositPaidHT = $depositPaidHT;
return $this;
}
public function getOutstandingBalanceHT(): ?string
{
return $this->outstandingBalanceHT;
}
public function setOutstandingBalanceHT(string $outstandingBalanceHT): self
{
$this->outstandingBalanceHT = $outstandingBalanceHT;
return $this;
}
public function getCheckDeposit(): ?bool
{
return $this->checkDeposit;
}
public function setCheckDeposit(bool $checkDeposit): self
{
$this->checkDeposit = $checkDeposit;
return $this;
}
public function getTotalAmountFees(): ?string
{
return $this->totalAmountFees;
}
public function setTotalAmountFees(?string $totalAmountFees): self
{
$this->totalAmountFees = $totalAmountFees;
return $this;
}
public function getTotalAmountDepositFees(): ?string
{
return $this->totalAmountDepositFees;
}
public function setTotalAmountDepositFees(?string $totalAmountDepositFees): self
{
$this->totalAmountDepositFees = $totalAmountDepositFees;
return $this;
}
public function getTotalAmountOutstandingFees(): ?string
{
return $this->totalAmountOutstandingFees;
}
public function setTotalAmountOutstandingFees(?string $totalAmountOutstandingFees): self
{
$this->totalAmountOutstandingFees = $totalAmountOutstandingFees;
return $this;
}
/**
* @return Collection|Billing[]
*/
public function getBilling(): Collection
{
return $this->billing;
}
public function addBilling(Billing $billing): self
{
if (!$this->billing->contains($billing)) {
$this->billing[] = $billing;
$billing->setShoppingCart($this);
}
return $this;
}
public function removeBilling(Billing $billing): self
{
if ($this->billing->removeElement($billing)) {
// set the owning side to null (unless already changed)
if ($billing->getShoppingCart() === $this) {
$billing->setShoppingCart(null);
}
}
return $this;
}
/**
* @return Collection|FeesBilling[]
*/
public function getFeesBilling(): Collection
{
return $this->feesBilling;
}
public function addFeesBilling(FeesBilling $feesBilling): self
{
if (!$this->feesBilling->contains($feesBilling)) {
$this->feesBilling[] = $feesBilling;
$feesBilling->setShoppingCart($this);
}
return $this;
}
public function removeFeesBilling(FeesBilling $feesBilling): self
{
if ($this->feesBilling->removeElement($feesBilling)) {
// set the owning side to null (unless already changed)
if ($feesBilling->getShoppingCart() === $this) {
$feesBilling->setShoppingCart(null);
}
}
return $this;
}
}