You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

пре 4 година
пре 4 година
пре 4 година
пре 4 година
пре 4 година
пре 4 година
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. <?php
  2. namespace Lc\ShopBundle\Model;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Lc\ShopBundle\Context\FilterMerchantInterface;
  7. /**
  8. * @ORM\MappedSuperclass()
  9. */
  10. abstract class OrderShop extends AbstractEntity implements FilterMerchantInterface
  11. {
  12. /**
  13. * @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\MerchantInterface", inversedBy="productFamilies")
  14. * @ORM\JoinColumn(nullable=false)
  15. */
  16. protected $merchant;
  17. /**
  18. * @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\UserInterface", inversedBy="orders")
  19. * @ORM\JoinColumn(nullable=false)
  20. */
  21. protected $user;
  22. /**
  23. * @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\AddressInterface", inversedBy="order")
  24. * @ORM\JoinColumn(nullable=false)
  25. */
  26. protected $invoiceAddress;
  27. /**
  28. * @ORM\Column(type="text", nullable=true)
  29. */
  30. protected $comment;
  31. /**
  32. * @ORM\Column(type="boolean", nullable=true)
  33. */
  34. protected $autoPayment;
  35. /**
  36. * @ORM\Column(type="string", length=31, nullable=true)
  37. */
  38. protected $meanPayment;
  39. /**
  40. * @ORM\Column(type="boolean", nullable=true)
  41. */
  42. protected $tillerSynchronisation;
  43. /**
  44. * @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\OrderStatusHistoryInterface", mappedBy="orderShop", orphanRemoval=true)
  45. */
  46. protected $orderStatusHistories;
  47. /**
  48. * @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\OrderProductInterface", mappedBy="orderShop", orphanRemoval=true)
  49. */
  50. protected $orderProducts;
  51. /**
  52. * @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\CreditHistoryInterface", mappedBy="orderShop", orphanRemoval=true)
  53. */
  54. protected $creditHistories;
  55. /**
  56. * @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\DocumentInvoiceInterface", inversedBy="orderShops")
  57. */
  58. protected $documentInvoice;
  59. /**
  60. * @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\DocumentQuotationInterface", inversedBy="orderShops")
  61. */
  62. protected $documentQuotation;
  63. /**
  64. * @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\DocumentDeliveryNoteInterface", inversedBy="orderShops")
  65. */
  66. protected $documentDeliveryNote;
  67. public function __construct()
  68. {
  69. $this->orderStatusHistories = new ArrayCollection();
  70. $this->orderProducts = new ArrayCollection();
  71. $this->creditHistories = new ArrayCollection();
  72. }
  73. public function getMerchant(): ?Merchant
  74. {
  75. return $this->merchant;
  76. }
  77. public function setMerchant(?Merchant $merchant): self
  78. {
  79. $this->merchant = $merchant;
  80. return $this;
  81. }
  82. public function getUser(): ?User
  83. {
  84. return $this->user;
  85. }
  86. public function setUser(?User $user): self
  87. {
  88. $this->user = $user;
  89. return $this;
  90. }
  91. public function getInvoiceAddress(): ?Address
  92. {
  93. return $this->invoiceAddress;
  94. }
  95. public function setInvoiceAddress(?Address $invoiceAddress): self
  96. {
  97. $this->invoiceAddress = $invoiceAddress;
  98. return $this;
  99. }
  100. public function getComment(): ?string
  101. {
  102. return $this->comment;
  103. }
  104. public function setComment(?string $comment): self
  105. {
  106. $this->comment = $comment;
  107. return $this;
  108. }
  109. public function getAutoPayment(): ?bool
  110. {
  111. return $this->autoPayment;
  112. }
  113. public function setAutoPayment(bool $autoPayment): self
  114. {
  115. $this->autoPayment = $autoPayment;
  116. return $this;
  117. }
  118. public function getMeanPayment(): ?string
  119. {
  120. return $this->meanPayment;
  121. }
  122. public function setMeanPayment(string $meanPayment): self
  123. {
  124. $this->meanPayment = $meanPayment;
  125. return $this;
  126. }
  127. /**
  128. * @return Collection|OrderStatusHistory[]
  129. */
  130. public function getOrderStatusHistories(): Collection
  131. {
  132. return $this->orderStatusHistories;
  133. }
  134. public function addOrderStatusHistory(OrderStatusHistory $orderStatusHistory): self
  135. {
  136. if (!$this->orderStatusHistories->contains($orderStatusHistory)) {
  137. $this->orderStatusHistories[] = $orderStatusHistory;
  138. $orderStatusHistory->setOrderShop($this);
  139. }
  140. return $this;
  141. }
  142. public function removeOrderStatusHistory(OrderStatusHistory $orderStatusHistory): self
  143. {
  144. if ($this->orderStatusHistories->contains($orderStatusHistory)) {
  145. $this->orderStatusHistories->removeElement($orderStatusHistory);
  146. // set the owning side to null (unless already changed)
  147. if ($orderStatusHistory->getOrderShop() === $this) {
  148. $orderStatusHistory->setOrderShop(null);
  149. }
  150. }
  151. return $this;
  152. }
  153. /**
  154. * @return Collection|OrderProduct[]
  155. */
  156. public function getOrderProducts(): Collection
  157. {
  158. return $this->orderProducts;
  159. }
  160. public function addOrderProduct(OrderProduct $orderProduct): self
  161. {
  162. if (!$this->orderProducts->contains($orderProduct)) {
  163. $this->orderProducts[] = $orderProduct;
  164. $orderProduct->setOrderShop($this);
  165. }
  166. return $this;
  167. }
  168. public function removeOrderProduct(OrderProduct $orderProduct): self
  169. {
  170. if ($this->orderProducts->contains($orderProduct)) {
  171. $this->orderProducts->removeElement($orderProduct);
  172. // set the owning side to null (unless already changed)
  173. if ($orderProduct->getOrderShop() === $this) {
  174. $orderProduct->setOrderShop(null);
  175. }
  176. }
  177. return $this;
  178. }
  179. /**
  180. * @return Collection|CreditHistory[]
  181. */
  182. public function getCreditHistories(): Collection
  183. {
  184. return $this->creditHistories;
  185. }
  186. public function addCreditHistory(CreditHistory $creditHistory): self
  187. {
  188. if (!$this->creditHistories->contains($creditHistory)) {
  189. $this->creditHistories[] = $creditHistory;
  190. $creditHistory->setOrderShop($this);
  191. }
  192. return $this;
  193. }
  194. public function removeCreditHistory(CreditHistory $creditHistory): self
  195. {
  196. if ($this->creditHistories->contains($creditHistory)) {
  197. $this->creditHistories->removeElement($creditHistory);
  198. // set the owning side to null (unless already changed)
  199. if ($creditHistory->getOrderShop() === $this) {
  200. $creditHistory->setOrderShop(null);
  201. }
  202. }
  203. return $this;
  204. }
  205. public function getDocumentInvoice(): ?DocumentInvoice
  206. {
  207. return $this->documentInvoice;
  208. }
  209. public function setDocumentInvoice(?DocumentInvoice $documentInvoice): self
  210. {
  211. $this->documentInvoice = $documentInvoice;
  212. return $this;
  213. }
  214. public function getDocumentQuotation(): ?DocumentQuotation
  215. {
  216. return $this->documentQuotation;
  217. }
  218. public function setDocumentQuotation(?DocumentQuotation $documentQuotation): self
  219. {
  220. $this->documentQuotation = $documentQuotation;
  221. return $this;
  222. }
  223. public function getDocumentDeliveryNote(): ?DocumentDeliveryNote
  224. {
  225. return $this->documentDeliveryNote;
  226. }
  227. public function setDocumentDeliveryNote(?DocumentDeliveryNote $documentDeliveryNote): self
  228. {
  229. $this->documentDeliveryNote = $documentDeliveryNote;
  230. return $this;
  231. }
  232. }