src/Entity/System/CartProduct.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity\System;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5. * Cart
  6. *
  7. * @ORM\Table(name="ps_cart_product", indexes={
  8. *
  9. * @ORM\Index(name="cart_product_index", columns={"id_cart", "id_product"}),
  10. * })
  11. *
  12. * @ORM\Entity(repositoryClass="App\Repository\System\CartProductRepository")
  13. */
  14. class CartProduct
  15. {
  16. /**
  17. * @var int
  18. *
  19. * @ORM\Id
  20. *
  21. * @ORM\GeneratedValue(strategy="AUTO")
  22. *
  23. * @ORM\Column(type="integer", name="id_cart_product")
  24. */
  25. private $id;
  26. /**
  27. * @var Cart
  28. *
  29. * @ORM\ManyToOne(targetEntity="App\Entity\System\Cart", inversedBy="cartProducts")
  30. *
  31. * @ORM\JoinColumn(name="id_cart", referencedColumnName="id_cart", nullable=false)
  32. */
  33. private $cart;
  34. /**
  35. * @var Product
  36. *
  37. * @ORM\ManyToOne(targetEntity="App\Entity\System\Product", inversedBy="cartProducts")
  38. *
  39. * @ORM\JoinColumn(name="id_product", referencedColumnName="id_product", nullable=false)
  40. */
  41. private $product;
  42. /**
  43. * @var ProductAttribute|null
  44. *
  45. * @ORM\ManyToOne(targetEntity="App\Entity\System\ProductAttribute", inversedBy="cartProducts")
  46. *
  47. * @ORM\JoinColumn(name="id_product_attribute", referencedColumnName="id_product_attribute", nullable=true)
  48. */
  49. private $productAttribute;
  50. /**
  51. * @var int
  52. *
  53. * @ORM\Column(type="integer", length=10, options={"default" : 0})
  54. */
  55. private $quantity;
  56. /**
  57. * @var \DateTime
  58. *
  59. * @ORM\Column(type="datetime")
  60. */
  61. private $dateAdd;
  62. /**
  63. * @var \DateTime
  64. *
  65. * @ORM\Column(type="datetime")
  66. */
  67. private $dateUpd;
  68. /**
  69. * @ORM\ManyToOne(targetEntity="Lock")
  70. *
  71. * @ORM\JoinColumn(name="locks", referencedColumnName="id_lock", nullable=true)
  72. */
  73. private ?Lock $lock;
  74. /**
  75. * @var string|null
  76. *
  77. * @ORM\Column(type="string", nullable=true, length=100)
  78. */
  79. private $internalReference;
  80. /**
  81. * @ORM\Column(name="shop_360_topic", type="integer", length=2, nullable=true)
  82. */
  83. private ?int $shop360Topic = null;
  84. /**
  85. * @return int
  86. */
  87. public function getId(): int
  88. {
  89. return $this->id;
  90. }
  91. /**
  92. * @param int|null $id
  93. *
  94. * @return CartProduct
  95. */
  96. public function setId(?int $id): CartProduct
  97. {
  98. $this->id = $id;
  99. return $this;
  100. }
  101. /**
  102. * @return Cart
  103. */
  104. public function getCart(): Cart
  105. {
  106. return $this->cart;
  107. }
  108. /**
  109. * @param Cart $cart
  110. *
  111. * @return CartProduct
  112. */
  113. public function setCart(Cart $cart): CartProduct
  114. {
  115. $this->cart = $cart;
  116. return $this;
  117. }
  118. public function getProduct(): Product
  119. {
  120. return $this->product;
  121. }
  122. public function setProduct(Product $product): CartProduct
  123. {
  124. $this->product = $product;
  125. return $this;
  126. }
  127. public function getProductAttribute(): ?ProductAttribute
  128. {
  129. return $this->productAttribute;
  130. }
  131. public function setProductAttribute(?ProductAttribute $productAttribute): CartProduct
  132. {
  133. $this->productAttribute = $productAttribute;
  134. return $this;
  135. }
  136. /**
  137. * @return int|null
  138. */
  139. public function getQuantity(): ?int
  140. {
  141. return $this->quantity;
  142. }
  143. /**
  144. * @param int $quantity
  145. *
  146. * @return CartProduct
  147. */
  148. public function setQuantity(int $quantity): CartProduct
  149. {
  150. $this->quantity = $quantity;
  151. return $this;
  152. }
  153. /**
  154. * @return \DateTime|null
  155. */
  156. public function getDateAdd(): ?\DateTime
  157. {
  158. return $this->dateAdd;
  159. }
  160. /**
  161. * @param \DateTime $dateAdd
  162. *
  163. * @return CartProduct
  164. */
  165. public function setDateAdd(\DateTime $dateAdd): CartProduct
  166. {
  167. $this->dateAdd = $dateAdd;
  168. return $this;
  169. }
  170. /**
  171. * @return \DateTime
  172. */
  173. public function getDateUpd(): \DateTime
  174. {
  175. return $this->dateUpd;
  176. }
  177. /**
  178. * @param \DateTime $dateUpd
  179. *
  180. * @return CartProduct
  181. */
  182. public function setDateUpd(\DateTime $dateUpd): CartProduct
  183. {
  184. $this->dateUpd = $dateUpd;
  185. return $this;
  186. }
  187. public function getLock(): ?Lock
  188. {
  189. return $this->lock;
  190. }
  191. public function setLock(?Lock $lock): CartProduct
  192. {
  193. $this->lock = $lock;
  194. return $this;
  195. }
  196. /**
  197. * @return string|null
  198. */
  199. public function getInternalReference(): ?string
  200. {
  201. return $this->internalReference;
  202. }
  203. /**
  204. * @param string|null $internalReference
  205. *
  206. * @return CartProduct
  207. */
  208. public function setInternalReference(?string $internalReference): CartProduct
  209. {
  210. $this->internalReference = $internalReference;
  211. return $this;
  212. }
  213. /**
  214. * @return int|null
  215. */
  216. public function getShop360Topic(): ?int
  217. {
  218. return $this->shop360Topic;
  219. }
  220. /**
  221. * @param int|null $shop360Topic
  222. *
  223. * @return CartProduct
  224. */
  225. public function setShop360Topic(?int $shop360Topic): CartProduct
  226. {
  227. $this->shop360Topic = $shop360Topic;
  228. return $this;
  229. }
  230. }