src/Entity/OrderItem.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5. * @ORM\Entity(repositoryClass="App\Repository\OrderItemRepository")
  6. * @ORM\EntityListeners({
  7. * "App\Listener\EntityListener",
  8. * "App\Listener\OrderListener"
  9. * })
  10. */
  11. class OrderItem
  12. {
  13. /**
  14. * @ORM\Id()
  15. * @ORM\GeneratedValue()
  16. * @ORM\Column(type="integer")
  17. */
  18. private $id;
  19. /**
  20. * @ORM\ManyToOne(targetEntity="App\Entity\Order", inversedBy="orderItems")
  21. * @ORM\JoinColumn(nullable=false)
  22. */
  23. private $order;
  24. /**
  25. * @ORM\ManyToOne(targetEntity="App\Entity\Product", inversedBy="orderItems")
  26. * @ORM\JoinColumn(nullable=true)
  27. */
  28. private $product;
  29. /**
  30. * @ORM\ManyToOne(targetEntity="App\Entity\Variant", inversedBy="orderItems")
  31. * @ORM\JoinColumn(nullable=false)
  32. */
  33. private $variant;
  34. /**
  35. * @ORM\ManyToOne(targetEntity="App\Entity\Dealer", inversedBy="orderItems")
  36. * @ORM\JoinColumn(nullable=false)
  37. */
  38. private $dealer;
  39. /**
  40. * @ORM\Column(type="string", length=190)
  41. */
  42. private $name;
  43. /**
  44. * @ORM\Column(type="float")
  45. */
  46. private $price = 0;
  47. /**
  48. * @ORM\Column(type="float")
  49. */
  50. private $priceNoTax = 0;
  51. /**
  52. * @ORM\Column(type="float")
  53. */
  54. private $tax = 0;
  55. /**
  56. * @ORM\Column(type="string", length=3)
  57. */
  58. private $currency;
  59. /**
  60. * @ORM\Column(type="integer")
  61. */
  62. private $count = 1;
  63. /**
  64. * @ORM\Column(type="integer")
  65. */
  66. private $status = 0;
  67. /**
  68. * @ORM\Column(type="datetime")
  69. */
  70. private $createts;
  71. /**
  72. * @ORM\Column(type="datetime", nullable=true)
  73. */
  74. private $editts;
  75. /**
  76. * @ORM\ManyToOne(targetEntity="App\Entity\User")
  77. */
  78. private $editUser;
  79. /**
  80. * @ORM\Column(type="float")
  81. */
  82. private $course;
  83. /**
  84. * @ORM\Column(type="text", nullable=true)
  85. */
  86. private $note;
  87. public function getId(): ?int
  88. {
  89. return $this->id;
  90. }
  91. public function getOrder(): ?Order
  92. {
  93. return $this->order;
  94. }
  95. public function setOrder(?Order $order): self
  96. {
  97. $this->order = $order;
  98. return $this;
  99. }
  100. public function getProduct(): ?Product
  101. {
  102. return $this->product;
  103. }
  104. public function setProduct(?Product $product): self
  105. {
  106. $this->product = $product;
  107. return $this;
  108. }
  109. public function getVariant(): ?Variant
  110. {
  111. return $this->variant;
  112. }
  113. public function setVariant(?Variant $variant): self
  114. {
  115. $this->variant = $variant;
  116. return $this;
  117. }
  118. public function getDealer(): ?Dealer
  119. {
  120. return $this->dealer;
  121. }
  122. public function setDealer(?Dealer $dealer): self
  123. {
  124. $this->dealer = $dealer;
  125. return $this;
  126. }
  127. public function getName(): ?string
  128. {
  129. return $this->name;
  130. }
  131. public function setName(string $name): self
  132. {
  133. $this->name = $name;
  134. return $this;
  135. }
  136. public function getPrice(): ?float
  137. {
  138. return $this->price;
  139. }
  140. public function setPrice(float $price): self
  141. {
  142. $this->price = $price;
  143. return $this;
  144. }
  145. public function getPriceNoTax(): ?float
  146. {
  147. return $this->priceNoTax;
  148. }
  149. public function setPriceNoTax(float $priceNoTax): self
  150. {
  151. $this->priceNoTax = $priceNoTax;
  152. return $this;
  153. }
  154. public function getTax(): ?float
  155. {
  156. return $this->tax;
  157. }
  158. public function setTax(float $tax): self
  159. {
  160. $this->tax = $tax;
  161. return $this;
  162. }
  163. public function getCurrency(): ?string
  164. {
  165. return $this->currency;
  166. }
  167. public function setCurrency(string $currency): self
  168. {
  169. $this->currency = $currency;
  170. return $this;
  171. }
  172. public function getCount(): ?int
  173. {
  174. return $this->count;
  175. }
  176. public function setCount(int $count): self
  177. {
  178. $this->count = $count;
  179. return $this;
  180. }
  181. public function getStatus(): ?int
  182. {
  183. return $this->status;
  184. }
  185. public function setStatus(?int $status): self
  186. {
  187. $this->status = $status;
  188. return $this;
  189. }
  190. public function getCreatets(): ?\DateTimeInterface
  191. {
  192. return $this->createts;
  193. }
  194. public function setCreatets(\DateTimeInterface $createts): self
  195. {
  196. $this->createts = $createts;
  197. return $this;
  198. }
  199. public function getEditts(): ?\DateTimeInterface
  200. {
  201. return $this->editts;
  202. }
  203. public function setEditts(?\DateTimeInterface $editts): self
  204. {
  205. $this->editts = $editts;
  206. return $this;
  207. }
  208. public function getEditUser(): ?User
  209. {
  210. return $this->editUser;
  211. }
  212. public function setEditUser(?User $editUser): self
  213. {
  214. $this->editUser = $editUser;
  215. return $this;
  216. }
  217. /**
  218. * Get Course
  219. *
  220. * @return mixed
  221. */
  222. public function getCourse()
  223. {
  224. return $this->course;
  225. }
  226. /**
  227. * Set Course
  228. *
  229. * @param mixed $course
  230. */
  231. public function setCourse( $course )
  232. {
  233. $this->course = $course;
  234. }
  235. /**
  236. * Get Note
  237. *
  238. * @return mixed
  239. */
  240. public function getNote()
  241. {
  242. return $this->note;
  243. }
  244. /**
  245. * Set Note
  246. *
  247. * @param mixed $note
  248. */
  249. public function setNote( $note )
  250. {
  251. $this->note = $note;
  252. }
  253. public function getItemName( )
  254. {
  255. return $this->getProduct()->getName().' - '.$this->getVariant()->getName();
  256. }
  257. }