|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271 |
- <?php
-
- namespace Lc\ShopBundle\Model;
-
- use Doctrine\Common\Collections\ArrayCollection;
- use Doctrine\Common\Collections\Collection;
- use Doctrine\ORM\Mapping as ORM;
-
- /**
- * @ORM\MappedSuperclass()
- */
- abstract class OrderShop extends AbstractEntity
- {
- /**
- * @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\UserInterface", inversedBy="orders")
- * @ORM\JoinColumn(nullable=false)
- */
- protected $user;
-
- /**
- * @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\AddressInterface", inversedBy="order")
- * @ORM\JoinColumn(nullable=false)
- */
- protected $invoiceAddress;
-
- /**
- * @ORM\Column(type="text", nullable=true)
- */
- protected $comment;
-
- /**
- * @ORM\Column(type="boolean")
- */
- protected $autoPayment;
-
- /**
- * @ORM\Column(type="string", length=31)
- */
- protected $meanPayment;
-
- /**
- * @ORM\Column(type="boolean", nullable=true)
- */
- protected $tillerSynchronisation;
-
- /**
- * @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\OrderStatusHistoryInterface", mappedBy="orderShop", orphanRemoval=true)
- */
- protected $orderStatusHistories;
-
- /**
- * @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\OrderProductInterface", mappedBy="orderShop", orphanRemoval=true)
- */
- protected $orderProducts;
-
- /**
- * @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\CreditHistoryInterface", mappedBy="orderShop", orphanRemoval=true)
- */
- protected $creditHistories;
-
- /**
- * @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\DocumentInvoiceInterface", inversedBy="orderShops")
- */
- protected $documentInvoice;
-
- /**
- * @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\DocumentQuotationInterface", inversedBy="orderShops")
- */
- protected $documentQuotation;
-
- /**
- * @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\DocumentDeliveryNoteInterface", inversedBy="orderShops")
- */
- protected $documentDeliveryNote;
-
- public function __construct()
- {
- $this->orderStatusHistories = new ArrayCollection();
- $this->orderProducts = new ArrayCollection();
- $this->creditHistories = new ArrayCollection();
- }
-
- public function getUser(): ?User
- {
- return $this->user;
- }
-
- public function setUser(?User $user): self
- {
- $this->user = $user;
-
- return $this;
- }
-
- public function getInvoiceAddress(): ?Address
- {
- return $this->invoiceAddress;
- }
-
- public function setInvoiceAddress(?Address $invoiceAddress): self
- {
- $this->invoiceAddress = $invoiceAddress;
-
- return $this;
- }
-
- public function getComment(): ?string
- {
- return $this->comment;
- }
-
- public function setComment(?string $comment): self
- {
- $this->comment = $comment;
-
- return $this;
- }
-
- public function getAutoPayment(): ?bool
- {
- return $this->autoPayment;
- }
-
- public function setAutoPayment(bool $autoPayment): self
- {
- $this->autoPayment = $autoPayment;
-
- return $this;
- }
-
- public function getMeanPayment(): ?string
- {
- return $this->meanPayment;
- }
-
- public function setMeanPayment(string $meanPayment): self
- {
- $this->meanPayment = $meanPayment;
-
- return $this;
- }
-
- /**
- * @return Collection|OrderStatusHistory[]
- */
- public function getOrderStatusHistories(): Collection
- {
- return $this->orderStatusHistories;
- }
-
- public function addOrderStatusHistory(OrderStatusHistory $orderStatusHistory): self
- {
- if (!$this->orderStatusHistories->contains($orderStatusHistory)) {
- $this->orderStatusHistories[] = $orderStatusHistory;
- $orderStatusHistory->setOrderShop($this);
- }
-
- return $this;
- }
-
- public function removeOrderStatusHistory(OrderStatusHistory $orderStatusHistory): self
- {
- if ($this->orderStatusHistories->contains($orderStatusHistory)) {
- $this->orderStatusHistories->removeElement($orderStatusHistory);
- // set the owning side to null (unless already changed)
- if ($orderStatusHistory->getOrderShop() === $this) {
- $orderStatusHistory->setOrderShop(null);
- }
- }
-
- return $this;
- }
-
- /**
- * @return Collection|OrderProduct[]
- */
- public function getOrderProducts(): Collection
- {
- return $this->orderProducts;
- }
-
- public function addOrderProduct(OrderProduct $orderProduct): self
- {
- if (!$this->orderProducts->contains($orderProduct)) {
- $this->orderProducts[] = $orderProduct;
- $orderProduct->setOrderShop($this);
- }
-
- return $this;
- }
-
- public function removeOrderProduct(OrderProduct $orderProduct): self
- {
- if ($this->orderProducts->contains($orderProduct)) {
- $this->orderProducts->removeElement($orderProduct);
- // set the owning side to null (unless already changed)
- if ($orderProduct->getOrderShop() === $this) {
- $orderProduct->setOrderShop(null);
- }
- }
-
- return $this;
- }
-
- /**
- * @return Collection|CreditHistory[]
- */
- public function getCreditHistories(): Collection
- {
- return $this->creditHistories;
- }
-
- public function addCreditHistory(CreditHistory $creditHistory): self
- {
- if (!$this->creditHistories->contains($creditHistory)) {
- $this->creditHistories[] = $creditHistory;
- $creditHistory->setOrderShop($this);
- }
-
- return $this;
- }
-
- public function removeCreditHistory(CreditHistory $creditHistory): self
- {
- if ($this->creditHistories->contains($creditHistory)) {
- $this->creditHistories->removeElement($creditHistory);
- // set the owning side to null (unless already changed)
- if ($creditHistory->getOrderShop() === $this) {
- $creditHistory->setOrderShop(null);
- }
- }
-
- return $this;
- }
-
- public function getDocumentInvoice(): ?DocumentInvoice
- {
- return $this->documentInvoice;
- }
-
- public function setDocumentInvoice(?DocumentInvoice $documentInvoice): self
- {
- $this->documentInvoice = $documentInvoice;
-
- return $this;
- }
-
- public function getDocumentQuotation(): ?DocumentQuotation
- {
- return $this->documentQuotation;
- }
-
- public function setDocumentQuotation(?DocumentQuotation $documentQuotation): self
- {
- $this->documentQuotation = $documentQuotation;
-
- return $this;
- }
-
- public function getDocumentDeliveryNote(): ?DocumentDeliveryNote
- {
- return $this->documentDeliveryNote;
- }
-
- public function setDocumentDeliveryNote(?DocumentDeliveryNote $documentDeliveryNote): self
- {
- $this->documentDeliveryNote = $documentDeliveryNote;
-
- return $this;
- }
- }
|