src/Entity/System/CartProduct.php line 19

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="id_product_attribute", columns={"id_product_attribute"}),
  10. * @ORM\Index(name="cart_product_index", columns={"id_cart", "id_product"}),
  11. * @ORM\Index(name="locks", columns={"locks"})
  12. * })
  13. *
  14. * @ORM\Entity(repositoryClass="App\Repository\System\CartProductRepository")
  15. */
  16. class CartProduct
  17. {
  18. /**
  19. * @var int
  20. *
  21. * @ORM\Id
  22. *
  23. * @ORM\GeneratedValue(strategy="AUTO")
  24. *
  25. * @ORM\Column(type="integer", name="id_cart_product")
  26. */
  27. private $id;
  28. /**
  29. * @var Cart
  30. *
  31. * @ORM\ManyToOne(targetEntity="App\Entity\System\Cart", inversedBy="cartProducts")
  32. *
  33. * @ORM\JoinColumn(name="id_cart", referencedColumnName="id_cart", nullable=false)
  34. */
  35. private $cart;
  36. /**
  37. * @var Product
  38. *
  39. * @ORM\ManyToOne(targetEntity="App\Entity\System\Product", inversedBy="cartProducts")
  40. *
  41. * @ORM\JoinColumn(name="id_product", referencedColumnName="id_product", nullable=false)
  42. */
  43. private $product;
  44. /**
  45. * @var ProductAttribute|null
  46. *
  47. * @ORM\ManyToOne(targetEntity="App\Entity\System\ProductAttribute", inversedBy="cartProducts")
  48. *
  49. * @ORM\JoinColumn(name="id_product_attribute", referencedColumnName="id_product_attribute", nullable=true)
  50. */
  51. private $productAttribute;
  52. /**
  53. * @var int
  54. *
  55. * @ORM\Column(type="integer", length=10, options={"default" : 0})
  56. */
  57. private $quantity;
  58. /**
  59. * @var \DateTime
  60. *
  61. * @ORM\Column(type="datetime")
  62. */
  63. private $dateAdd;
  64. /**
  65. * @var \DateTime
  66. *
  67. * @ORM\Column(type="datetime")
  68. */
  69. private $dateUpd;
  70. /**
  71. * @var int|null
  72. *
  73. * @ORM\Column(type="integer", length=10, nullable=true, options={"default" : 0})
  74. */
  75. private $locks;
  76. /**
  77. * @ORM\Column(type="boolean", nullable=false, options={"default" : 0})
  78. */
  79. private bool $futureStock;
  80. /**
  81. * @ORM\Column(type="boolean", nullable=false, options={"default" : 0})
  82. */
  83. private bool $externStock;
  84. /**
  85. * @var int|null
  86. *
  87. * @ORM\Column(name="id_purchase_line", type="integer", nullable=true)
  88. */
  89. private $purchaseOrderReference;
  90. /**
  91. * @var string|null
  92. *
  93. * @ORM\Column(type="string", nullable=true, length=100)
  94. */
  95. private $internalReference;
  96. /**
  97. * @ORM\Column(name="extern_stock_3_5", type="boolean", nullable=false, options={"default" : 0})
  98. */
  99. private bool $externStock3To5;
  100. /**
  101. * @ORM\Column(name="shop_360_topic", type="integer", length=2, nullable=true)
  102. */
  103. private ?int $shop360Topic = null;
  104. public function __construct()
  105. {
  106. $this->futureStock = false;
  107. $this->externStock = false;
  108. $this->externStock3To5 = false;
  109. }
  110. /**
  111. * @return int
  112. */
  113. public function getId(): int
  114. {
  115. return $this->id;
  116. }
  117. /**
  118. * @param int|null $id
  119. *
  120. * @return CartProduct
  121. */
  122. public function setId(?int $id): CartProduct
  123. {
  124. $this->id = $id;
  125. return $this;
  126. }
  127. /**
  128. * @return Cart
  129. */
  130. public function getCart(): Cart
  131. {
  132. return $this->cart;
  133. }
  134. /**
  135. * @param Cart $cart
  136. *
  137. * @return CartProduct
  138. */
  139. public function setCart(Cart $cart): CartProduct
  140. {
  141. $this->cart = $cart;
  142. return $this;
  143. }
  144. public function getProduct(): Product
  145. {
  146. return $this->product;
  147. }
  148. public function setProduct(Product $product): CartProduct
  149. {
  150. $this->product = $product;
  151. return $this;
  152. }
  153. public function getProductAttribute(): ?ProductAttribute
  154. {
  155. return $this->productAttribute;
  156. }
  157. public function setProductAttribute(?ProductAttribute $productAttribute): CartProduct
  158. {
  159. $this->productAttribute = $productAttribute;
  160. return $this;
  161. }
  162. /**
  163. * @return int|null
  164. */
  165. public function getQuantity(): ?int
  166. {
  167. return $this->quantity;
  168. }
  169. /**
  170. * @param int $quantity
  171. *
  172. * @return CartProduct
  173. */
  174. public function setQuantity(int $quantity): CartProduct
  175. {
  176. $this->quantity = $quantity;
  177. return $this;
  178. }
  179. /**
  180. * @return \DateTime|null
  181. */
  182. public function getDateAdd(): ?\DateTime
  183. {
  184. return $this->dateAdd;
  185. }
  186. /**
  187. * @param \DateTime $dateAdd
  188. *
  189. * @return CartProduct
  190. */
  191. public function setDateAdd(\DateTime $dateAdd): CartProduct
  192. {
  193. $this->dateAdd = $dateAdd;
  194. return $this;
  195. }
  196. /**
  197. * @return \DateTime
  198. */
  199. public function getDateUpd(): \DateTime
  200. {
  201. return $this->dateUpd;
  202. }
  203. /**
  204. * @param \DateTime $dateUpd
  205. *
  206. * @return CartProduct
  207. */
  208. public function setDateUpd(\DateTime $dateUpd): CartProduct
  209. {
  210. $this->dateUpd = $dateUpd;
  211. return $this;
  212. }
  213. /**
  214. * @return int|null
  215. */
  216. public function getLocks(): ?int
  217. {
  218. return $this->locks;
  219. }
  220. /**
  221. * @param int|null $locks
  222. *
  223. * @return CartProduct
  224. */
  225. public function setLocks(?int $locks): CartProduct
  226. {
  227. $this->locks = $locks;
  228. return $this;
  229. }
  230. public function getFutureStock(): bool
  231. {
  232. return $this->futureStock;
  233. }
  234. public function setFutureStock(bool $futureStock): CartProduct
  235. {
  236. $this->futureStock = $futureStock;
  237. return $this;
  238. }
  239. public function getExternStock(): bool
  240. {
  241. return $this->externStock;
  242. }
  243. public function setExternStock(bool $externStock): CartProduct
  244. {
  245. $this->externStock = $externStock;
  246. return $this;
  247. }
  248. /**
  249. * @return int|null
  250. */
  251. public function getPurchaseOrderReference(): ?int
  252. {
  253. return $this->purchaseOrderReference;
  254. }
  255. /**
  256. * @param int|null $purchaseOrderReference
  257. *
  258. * @return CartProduct
  259. */
  260. public function setPurchaseOrderReference(?int $purchaseOrderReference): CartProduct
  261. {
  262. $this->purchaseOrderReference = $purchaseOrderReference;
  263. return $this;
  264. }
  265. /**
  266. * @return string|null
  267. */
  268. public function getInternalReference(): ?string
  269. {
  270. return $this->internalReference;
  271. }
  272. /**
  273. * @param string|null $internalReference
  274. *
  275. * @return CartProduct
  276. */
  277. public function setInternalReference(?string $internalReference): CartProduct
  278. {
  279. $this->internalReference = $internalReference;
  280. return $this;
  281. }
  282. public function isExternStock3To5(): bool
  283. {
  284. return $this->externStock3To5;
  285. }
  286. public function setExternStock3To5(bool $externStock3To5): CartProduct
  287. {
  288. $this->externStock3To5 = $externStock3To5;
  289. return $this;
  290. }
  291. /**
  292. * @return int|null
  293. */
  294. public function getShop360Topic(): ?int
  295. {
  296. return $this->shop360Topic;
  297. }
  298. /**
  299. * @param int|null $shop360Topic
  300. *
  301. * @return CartProduct
  302. */
  303. public function setShop360Topic(?int $shop360Topic): CartProduct
  304. {
  305. $this->shop360Topic = $shop360Topic;
  306. return $this;
  307. }
  308. }