src/Entity/OrderDetails.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\OrderDetailsRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassOrderDetailsRepository::class)]
  8. class OrderDetails
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\ManyToOne(targetEntityUser::class, inversedBy'orderDetails')]
  15.     private $user;
  16.     #[ORM\Column(type'float'nullabletrue)]
  17.     private $total;
  18.     #[ORM\Column(type'datetime'nullabletrue)]
  19.     private $createdAt;
  20.     #[ORM\Column(type'datetime'nullabletrue)]
  21.     private $modifiedAt;
  22.     #[ORM\OneToMany(mappedBy'orderDetails'targetEntityOrderItems::class, cascade: ['persist''remove'])]
  23.     private $orderItems;
  24.     #[ORM\OneToOne(inversedBy'orderDetails'targetEntityOrderBillingDetails::class, cascade: ['persist''remove'])]
  25.     private $orderBillingDetails;
  26.     #[ORM\Column(type'string'length255nullabletrue)]
  27.     private $xeroId;
  28.     #[ORM\Column(type'string'length255nullabletrue)]
  29.     private $type;
  30.     #[ORM\OneToOne(mappedBy'orderDetails'targetEntityPaymentDetails::class, cascade: ['persist''remove'])]
  31.     private $paymentDetails;
  32.     #[ORM\Column(type'string'length255nullabletrue)]
  33.     private $invoiceNumber;
  34.     #[ORM\Column(type'string'length255nullabletrue)]
  35.     private $transactionId;
  36.     #[ORM\Column(length255nullabletrue)]
  37.     private ?string $salesforceId null;
  38.     #[ORM\OneToOne(cascade: ['persist''remove'])]
  39.     private ?FilmProject $filmProject null;
  40.     #[ORM\OneToOne(mappedBy'orderDetails'targetEntityDonation::class, cascade: ['persist''remove'])]
  41.     private $donation null;
  42.     #[ORM\Column(nullabletrue)]
  43.     private ?bool $isRefund null;
  44.     #[ORM\Column(length255nullabletrue)]
  45.     private ?string $refundXeroId null;
  46.     #[ORM\Column(length255nullabletrue)]
  47.     private ?string $xeroContactId null;
  48.     #[ORM\Column(length255nullabletrue)]
  49.     private ?string $popupSalesforceId null;
  50.     private ?string $mwId;
  51.     public function __construct()
  52.     {
  53.         $this->orderItems = new ArrayCollection();
  54.     }
  55.     public function getId(): ?int
  56.     {
  57.         return $this->id;
  58.     }
  59.     public function getUser(): ?User
  60.     {
  61.         return $this->user;
  62.     }
  63.     public function setUser(?User $user): self
  64.     {
  65.         $this->user $user;
  66.         return $this;
  67.     }
  68.     public function getTotal(): ?float
  69.     {
  70.         return $this->total;
  71.     }
  72.     public function setTotal(?float $total): self
  73.     {
  74.         $this->total $total;
  75.         return $this;
  76.     }
  77.     public function getCreatedAt(): ?\DateTimeInterface
  78.     {
  79.         return $this->createdAt;
  80.     }
  81.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  82.     {
  83.         $this->createdAt $createdAt;
  84.         return $this;
  85.     }
  86.     public function getModifiedAt(): ?\DateTimeInterface
  87.     {
  88.         return $this->modifiedAt;
  89.     }
  90.     public function setModifiedAt(?\DateTimeInterface $modifiedAt): self
  91.     {
  92.         $this->modifiedAt $modifiedAt;
  93.         return $this;
  94.     }
  95.     /**
  96.      * @return Collection<int, OrderItems>
  97.      */
  98.     public function getOrderItems(): Collection
  99.     {
  100.         return $this->orderItems;
  101.     }
  102.     public function addOrderItem(OrderItems $orderItem): self
  103.     {
  104.         if (!$this->orderItems->contains($orderItem)) {
  105.             $this->orderItems[] = $orderItem;
  106.             $orderItem->setOrderDetails($this);
  107.         }
  108.         return $this;
  109.     }
  110.     public function removeOrderItem(OrderItems $orderItem): self
  111.     {
  112.         if ($this->orderItems->removeElement($orderItem)) {
  113.             // set the owning side to null (unless already changed)
  114.             if ($orderItem->getOrderDetails() === $this) {
  115.                 $orderItem->setOrderDetails(null);
  116.             }
  117.         }
  118.         return $this;
  119.     }
  120.     public function getOrderBillingDetails(): ?OrderBillingDetails
  121.     {
  122.         return $this->orderBillingDetails;
  123.     }
  124.     public function setOrderBillingDetails(?OrderBillingDetails $orderBillingDetails): self
  125.     {
  126.         $this->orderBillingDetails $orderBillingDetails;
  127.         return $this;
  128.     }
  129.     public function getXeroId(): ?string
  130.     {
  131.         return $this->xeroId;
  132.     }
  133.     public function setXeroId(?string $xeroId): self
  134.     {
  135.         $this->xeroId $xeroId;
  136.         return $this;
  137.     }
  138.     public function getType(): ?string
  139.     {
  140.         return $this->type;
  141.     }
  142.     public function setType(?string $type): self
  143.     {
  144.         $this->type $type;
  145.         return $this;
  146.     }
  147.     public function getPaymentDetails(): ?PaymentDetails
  148.     {
  149.         return $this->paymentDetails;
  150.     }
  151.     public function setPaymentDetails(?PaymentDetails $paymentDetails): self
  152.     {
  153.         // unset the owning side of the relation if necessary
  154.         if ($paymentDetails === null && $this->paymentDetails !== null) {
  155.             $this->paymentDetails->setOrderDetails(null);
  156.         }
  157.         // set the owning side of the relation if necessary
  158.         if ($paymentDetails !== null && $paymentDetails->getOrderDetails() !== $this) {
  159.             $paymentDetails->setOrderDetails($this);
  160.         }
  161.         $this->paymentDetails $paymentDetails;
  162.         return $this;
  163.     }
  164.     public function getInvoiceNumber(): ?string
  165.     {
  166.         return $this->invoiceNumber;
  167.     }
  168.     public function setInvoiceNumber(?string $invoiceNumber): self
  169.     {
  170.         $this->invoiceNumber $invoiceNumber;
  171.         return $this;
  172.     }
  173.     public function getTransactionId(): ?string
  174.     {
  175.         return $this->transactionId;
  176.     }
  177.     public function setTransactionId(?string $transactionId): self
  178.     {
  179.         $this->transactionId $transactionId;
  180.         return $this;
  181.     }
  182.     public function getSalesforceId(): ?string
  183.     {
  184.         return $this->salesforceId;
  185.     }
  186.     public function setSalesforceId(?string $salesforceId): self
  187.     {
  188.         $this->salesforceId $salesforceId;
  189.         return $this;
  190.     }
  191.     public function getFilmProject(): ?FilmProject
  192.     {
  193.         return $this->filmProject;
  194.     }
  195.     public function setFilmProject(?FilmProject $filmProject): self
  196.     {
  197.         $this->filmProject $filmProject;
  198.         return $this;
  199.     }
  200.     public function getDonation(): ?Donation
  201.     {
  202.         return $this->donation;
  203.     }
  204.     public function setDonation(?Donation $donation): self
  205.     {
  206.         $this->donation $donation;
  207.         return $this;
  208.     }
  209.     public function getProjectTitle(): string
  210.     {
  211.         if ($this->donation) {
  212.             $filmProject $this->donation->getFilmProject();
  213.             if ($filmProject)
  214.                 return $filmProject->getTitle();
  215.         }
  216.         
  217.         if ($this->filmProject)
  218.             return $this->filmProject->getTitle();
  219.         
  220.         return 'Documentary Australia';
  221.     }
  222.     public function getMwId()
  223.     {
  224.         return 'MW'$this->id;
  225.     }
  226.     public function isIsRefund(): ?bool
  227.     {
  228.         return $this->isRefund;
  229.     }
  230.     public function setIsRefund(?bool $isRefund): self
  231.     {
  232.         $this->isRefund $isRefund;
  233.         return $this;
  234.     }
  235.     public function getRefundXeroId(): ?string
  236.     {
  237.         return $this->refundXeroId;
  238.     }
  239.     public function setRefundXeroId(?string $refundXeroId): self
  240.     {
  241.         $this->refundXeroId $refundXeroId;
  242.         return $this;
  243.     }
  244.     public function getXeroContactId(): ?string
  245.     {
  246.         return $this->xeroContactId;
  247.     }
  248.     public function setXeroContactId(?string $xeroContactId): self
  249.     {
  250.         $this->xeroContactId $xeroContactId;
  251.         return $this;
  252.     }
  253.     public function getPopupSalesforceId(): ?string
  254.     {
  255.         return $this->popupSalesforceId;
  256.     }
  257.     public function setPopupSalesforceId(?string $popupSalesforceId): self
  258.     {
  259.         $this->popupSalesforceId $popupSalesforceId;
  260.         return $this;
  261.     }
  262. }