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.     public function __construct()
  51.     {
  52.         $this->orderItems = new ArrayCollection();
  53.     }
  54.     public function getId(): ?int
  55.     {
  56.         return $this->id;
  57.     }
  58.     public function getUser(): ?User
  59.     {
  60.         return $this->user;
  61.     }
  62.     public function setUser(?User $user): self
  63.     {
  64.         $this->user $user;
  65.         return $this;
  66.     }
  67.     public function getTotal(): ?float
  68.     {
  69.         return $this->total;
  70.     }
  71.     public function setTotal(?float $total): self
  72.     {
  73.         $this->total $total;
  74.         return $this;
  75.     }
  76.     public function getCreatedAt(): ?\DateTimeInterface
  77.     {
  78.         return $this->createdAt;
  79.     }
  80.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  81.     {
  82.         $this->createdAt $createdAt;
  83.         return $this;
  84.     }
  85.     public function getModifiedAt(): ?\DateTimeInterface
  86.     {
  87.         return $this->modifiedAt;
  88.     }
  89.     public function setModifiedAt(?\DateTimeInterface $modifiedAt): self
  90.     {
  91.         $this->modifiedAt $modifiedAt;
  92.         return $this;
  93.     }
  94.     /**
  95.      * @return Collection<int, OrderItems>
  96.      */
  97.     public function getOrderItems(): Collection
  98.     {
  99.         return $this->orderItems;
  100.     }
  101.     public function addOrderItem(OrderItems $orderItem): self
  102.     {
  103.         if (!$this->orderItems->contains($orderItem)) {
  104.             $this->orderItems[] = $orderItem;
  105.             $orderItem->setOrderDetails($this);
  106.         }
  107.         return $this;
  108.     }
  109.     public function removeOrderItem(OrderItems $orderItem): self
  110.     {
  111.         if ($this->orderItems->removeElement($orderItem)) {
  112.             // set the owning side to null (unless already changed)
  113.             if ($orderItem->getOrderDetails() === $this) {
  114.                 $orderItem->setOrderDetails(null);
  115.             }
  116.         }
  117.         return $this;
  118.     }
  119.     public function getOrderBillingDetails(): ?OrderBillingDetails
  120.     {
  121.         return $this->orderBillingDetails;
  122.     }
  123.     public function setOrderBillingDetails(?OrderBillingDetails $orderBillingDetails): self
  124.     {
  125.         $this->orderBillingDetails $orderBillingDetails;
  126.         return $this;
  127.     }
  128.     public function getXeroId(): ?string
  129.     {
  130.         return $this->xeroId;
  131.     }
  132.     public function setXeroId(?string $xeroId): self
  133.     {
  134.         $this->xeroId $xeroId;
  135.         return $this;
  136.     }
  137.     public function getType(): ?string
  138.     {
  139.         return $this->type;
  140.     }
  141.     public function setType(?string $type): self
  142.     {
  143.         $this->type $type;
  144.         return $this;
  145.     }
  146.     public function getPaymentDetails(): ?PaymentDetails
  147.     {
  148.         return $this->paymentDetails;
  149.     }
  150.     public function setPaymentDetails(?PaymentDetails $paymentDetails): self
  151.     {
  152.         // unset the owning side of the relation if necessary
  153.         if ($paymentDetails === null && $this->paymentDetails !== null) {
  154.             $this->paymentDetails->setOrderDetails(null);
  155.         }
  156.         // set the owning side of the relation if necessary
  157.         if ($paymentDetails !== null && $paymentDetails->getOrderDetails() !== $this) {
  158.             $paymentDetails->setOrderDetails($this);
  159.         }
  160.         $this->paymentDetails $paymentDetails;
  161.         return $this;
  162.     }
  163.     public function getInvoiceNumber(): ?string
  164.     {
  165.         return $this->invoiceNumber;
  166.     }
  167.     public function setInvoiceNumber(?string $invoiceNumber): self
  168.     {
  169.         $this->invoiceNumber $invoiceNumber;
  170.         return $this;
  171.     }
  172.     public function getTransactionId(): ?string
  173.     {
  174.         return $this->transactionId;
  175.     }
  176.     public function setTransactionId(?string $transactionId): self
  177.     {
  178.         $this->transactionId $transactionId;
  179.         return $this;
  180.     }
  181.     public function getSalesforceId(): ?string
  182.     {
  183.         return $this->salesforceId;
  184.     }
  185.     public function setSalesforceId(?string $salesforceId): self
  186.     {
  187.         $this->salesforceId $salesforceId;
  188.         return $this;
  189.     }
  190.     public function getFilmProject(): ?FilmProject
  191.     {
  192.         return $this->filmProject;
  193.     }
  194.     public function setFilmProject(?FilmProject $filmProject): self
  195.     {
  196.         $this->filmProject $filmProject;
  197.         return $this;
  198.     }
  199.     public function getDonation(): ?Donation
  200.     {
  201.         return $this->donation;
  202.     }
  203.     public function setDonation(?Donation $donation): self
  204.     {
  205.         $this->donation $donation;
  206.         return $this;
  207.     }
  208.     public function getProjectTitle(): string
  209.     {
  210.         if ($this->donation) {
  211.             $filmProject $this->donation->getFilmProject();
  212.             if ($filmProject)
  213.                 return $filmProject->getTitle();
  214.         }
  215.         
  216.         if ($this->filmProject)
  217.             return $this->filmProject->getTitle();
  218.         
  219.         return 'Documentary Australia';
  220.     }
  221.     public function getMwId()
  222.     {
  223.         return 'MW'$this->id;
  224.     }
  225.     public function isIsRefund(): ?bool
  226.     {
  227.         return $this->isRefund;
  228.     }
  229.     public function setIsRefund(?bool $isRefund): self
  230.     {
  231.         $this->isRefund $isRefund;
  232.         return $this;
  233.     }
  234.     public function getRefundXeroId(): ?string
  235.     {
  236.         return $this->refundXeroId;
  237.     }
  238.     public function setRefundXeroId(?string $refundXeroId): self
  239.     {
  240.         $this->refundXeroId $refundXeroId;
  241.         return $this;
  242.     }
  243.     public function getXeroContactId(): ?string
  244.     {
  245.         return $this->xeroContactId;
  246.     }
  247.     public function setXeroContactId(?string $xeroContactId): self
  248.     {
  249.         $this->xeroContactId $xeroContactId;
  250.         return $this;
  251.     }
  252.     public function getPopupSalesforceId(): ?string
  253.     {
  254.         return $this->popupSalesforceId;
  255.     }
  256.     public function setPopupSalesforceId(?string $popupSalesforceId): self
  257.     {
  258.         $this->popupSalesforceId $popupSalesforceId;
  259.         return $this;
  260.     }
  261. }