src/Entity/System/StockAvailable.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Entity\System;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5. * @ORM\Table(name="ps_stock_available",
  6. * uniqueConstraints={
  7. *
  8. * @ORM\UniqueConstraint(name="uk_product_product_attribute", columns={"id_product", "id_product_attribute"})
  9. * })
  10. *
  11. * @ORM\Entity(repositoryClass="App\Repository\System\StockAvailableRepository")
  12. *
  13. * @deprecated Use ProductStock instead
  14. */
  15. class StockAvailable
  16. {
  17. public const JIT_MIN_DAYS = 1;
  18. public const JIT_MAX_DAYS = 2;
  19. public const JIT_3_5_MIN_DAYS = 3;
  20. public const JIT_3_5_MAX_DAYS = 5;
  21. public const IMMEDIATE_STOCK_MIN_DAYS = 0;
  22. public const IMMEDIATE_STOCK_MAX_DAYS = 0;
  23. public const UNLIMITED_STOCK_FOR_NO_DEPENDS_ON_STOCK_QUANTITY = 500;
  24. /**
  25. * @var int
  26. *
  27. * @ORM\Column(name="id_stock_available", type="integer")
  28. *
  29. * @ORM\Id
  30. *
  31. * @ORM\GeneratedValue(strategy="AUTO")
  32. */
  33. private $id;
  34. /**
  35. * @var Product
  36. *
  37. * @ORM\ManyToOne(targetEntity="Product", inversedBy="stocks")
  38. *
  39. * @ORM\JoinColumn(name="id_product", referencedColumnName="id_product", nullable=false)
  40. *
  41. * @ORM\OrderBy({"id_product_attribute" = "ASC", "reference" = "DESC"})
  42. */
  43. private $product;
  44. /**
  45. * @var Warehouse
  46. *
  47. * @ORM\ManyToOne(targetEntity="App\Entity\System\Warehouse")
  48. *
  49. * @ORM\JoinColumn(name="id_warehouse", referencedColumnName="id", nullable=false, options={"default":1})
  50. *
  51. * @deprecated Use ProductStock instead
  52. */
  53. private $warehouse;
  54. /**
  55. * @var ProductAttribute|null
  56. *
  57. * @ORM\OneToOne(targetEntity="ProductAttribute", inversedBy="stock")
  58. *
  59. * @ORM\JoinColumn(name="id_product_attribute", referencedColumnName="id_product_attribute", nullable=true)
  60. */
  61. private $productAttribute;
  62. /**
  63. * @ORM\Column(type="integer", options={"default":0})
  64. *
  65. * @deprecated Use ProductStock instead
  66. */
  67. private int $quantity;
  68. /**
  69. * @ORM\Column(type="integer", options={"default":0})
  70. *
  71. * @deprecated Use ProductStock instead
  72. */
  73. private int $quantityStockSupplier;
  74. /**
  75. * @ORM\Column(type="integer", nullable=true, options={"default":0})
  76. */
  77. private ?int $quantityStockSupplierToShow;
  78. /**
  79. * @ORM\Column(name="quantity_stock_supplier_3_5", type="integer", nullable=false, options={"default":0})
  80. *
  81. * @deprecated Use ProductStock instead
  82. */
  83. private int $quantityStockSupplier3To5;
  84. /**
  85. * @ORM\Column(type="integer", options={"default":0})
  86. *
  87. * @deprecated Use ProductStock instead
  88. */
  89. private int $quantityFutureStock;
  90. /**
  91. * @ORM\Column(type="integer", nullable=false, options={"default":0})
  92. *
  93. * @deprecated Use ProductStock instead
  94. */
  95. private int $stockExtern;
  96. /**
  97. * @ORM\Column(name="stock_extern_3_5", type="integer", nullable=false, options={"default":0})
  98. *
  99. * @deprecated Use ProductStock instead
  100. */
  101. private int $stockExtern3To5;
  102. /**
  103. * @var \DateTime
  104. *
  105. * @ORM\Column(type="datetime", options={"default" : "CURRENT_TIMESTAMP"})
  106. */
  107. private $dateUpd;
  108. /**
  109. * @return int
  110. */
  111. public function getId(): int
  112. {
  113. return $this->id;
  114. }
  115. public function setId(int $id): StockAvailable
  116. {
  117. $this->id = $id;
  118. return $this;
  119. }
  120. public function getProduct(): Product
  121. {
  122. return $this->product;
  123. }
  124. /**
  125. * @param Product $product
  126. *
  127. * @return StockAvailable
  128. */
  129. public function setProduct(Product $product): StockAvailable
  130. {
  131. $this->product = $product;
  132. return $this;
  133. }
  134. public function getProductAttribute(): ?ProductAttribute
  135. {
  136. return $this->productAttribute;
  137. }
  138. public function setProductAttribute(?ProductAttribute $productAttribute = null): StockAvailable
  139. {
  140. $this->productAttribute = $productAttribute;
  141. return $this;
  142. }
  143. /**
  144. * @deprecated Use ProductStock instead
  145. */
  146. public function getQuantity(): int
  147. {
  148. return $this->quantity;
  149. }
  150. /**
  151. * @deprecated Use ProductStock instead
  152. */
  153. public function setQuantity(int $quantity): StockAvailable
  154. {
  155. $this->quantity = $quantity;
  156. return $this;
  157. }
  158. /**
  159. * @deprecated Use ProductStock instead
  160. */
  161. public function getQuantityStockSupplier(): int
  162. {
  163. return $this->quantityStockSupplier;
  164. }
  165. /**
  166. * @deprecated Use ProductStock instead
  167. */
  168. public function setQuantityStockSupplier(int $quantityStockSupplier): StockAvailable
  169. {
  170. $this->quantityStockSupplier = $quantityStockSupplier;
  171. return $this;
  172. }
  173. /**
  174. * @deprecated Use ProductStock instead
  175. */
  176. public function getQuantityFutureStock(): int
  177. {
  178. return $this->quantityFutureStock;
  179. }
  180. /**
  181. * @deprecated Use ProductStock instead
  182. */
  183. public function setQuantityFutureStock(int $quantityFutureStock): StockAvailable
  184. {
  185. $this->quantityFutureStock = $quantityFutureStock;
  186. return $this;
  187. }
  188. /**
  189. * @deprecated Use ProductStock instead
  190. */
  191. public function getStockExtern(): ?int
  192. {
  193. return $this->stockExtern;
  194. }
  195. /**
  196. * @deprecated Use ProductStock instead
  197. */
  198. public function setStockExtern(?int $stockExtern): StockAvailable
  199. {
  200. $this->stockExtern = $stockExtern;
  201. return $this;
  202. }
  203. /**
  204. * @return \DateTime
  205. */
  206. public function getDateUpd(): \DateTime
  207. {
  208. return $this->dateUpd;
  209. }
  210. /**
  211. * @param \DateTime $dateUpd
  212. *
  213. * @return StockAvailable
  214. */
  215. public function setDateUpd(\DateTime $dateUpd): StockAvailable
  216. {
  217. $this->dateUpd = $dateUpd;
  218. return $this;
  219. }
  220. /**
  221. * @deprecated Use ProductStock instead
  222. */
  223. public function getQuantityStockSupplier3To5(): int
  224. {
  225. return $this->quantityStockSupplier3To5;
  226. }
  227. /**
  228. * @deprecated Use ProductStock instead
  229. */
  230. public function setQuantityStockSupplier3To5(int $quantityStockSupplier3To5): void
  231. {
  232. $this->quantityStockSupplier3To5 = $quantityStockSupplier3To5;
  233. }
  234. /**
  235. * @deprecated Use ProductStock instead
  236. */
  237. public function getStockExtern3To5(): int
  238. {
  239. return $this->stockExtern3To5;
  240. }
  241. /**
  242. * @deprecated Use ProductStock instead
  243. */
  244. public function setStockExtern3To5(int $stockExtern3To5): void
  245. {
  246. $this->stockExtern3To5 = $stockExtern3To5;
  247. }
  248. /**
  249. * @deprecated Use ProductStock instead
  250. */
  251. public function getWarehouse(): Warehouse
  252. {
  253. return $this->warehouse;
  254. }
  255. /**
  256. * @deprecated Use ProductStock instead
  257. */
  258. public function setWarehouse(Warehouse $warehouse): void
  259. {
  260. $this->warehouse = $warehouse;
  261. }
  262. public function getQuantityStockSupplierToShow(): ?int
  263. {
  264. return $this->quantityStockSupplierToShow;
  265. }
  266. public function setQuantityStockSupplierToShow(?int $quantityStockSupplierToShow): StockAvailable
  267. {
  268. $this->quantityStockSupplierToShow = $quantityStockSupplierToShow;
  269. return $this;
  270. }
  271. }