src/Entity/System/ProductAttribute.php line 29

Open in your IDE?
  1. <?php
  2. namespace App\Entity\System;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7. * ProductAttribute
  8. *
  9. * @ORM\Table(
  10. * name="ps_product_attribute",
  11. * uniqueConstraints={
  12. *
  13. * @ORM\UniqueConstraint(name="reference_unique", columns={"reference"})
  14. * },
  15. * indexes={
  16. *
  17. * @ORM\Index(name="product_default", columns={"id_product", "default_on"}),
  18. * @ORM\Index(name="id_product_id_product_attribute", columns={"id_product", "id_product_attribute"}),
  19. * @ORM\Index(name="position", columns={"position"}),
  20. * @ORM\Index(name="supplier_reference", columns={"supplier_reference"})
  21. * }
  22. * )
  23. *
  24. * @ORM\Entity(repositoryClass="App\Repository\System\ProductAttributeRepository")
  25. */
  26. class ProductAttribute
  27. {
  28. public const CM_SUFFIX = '_CM';
  29. public const MP_SUFFIX = '_MP';
  30. /**
  31. * @var int
  32. *
  33. * @ORM\Column(name="id_product_attribute", type="integer")
  34. *
  35. * @ORM\Id
  36. *
  37. * @ORM\GeneratedValue(strategy="AUTO")
  38. */
  39. private $id;
  40. /**
  41. * @var string|null
  42. *
  43. * @ORM\Column(name="ean13", type="string", length=13, nullable=true)
  44. */
  45. private $ean;
  46. /**
  47. * @var string|null
  48. *
  49. * @ORM\Column(name="ean13_2", type="string", length=13, nullable=true)
  50. */
  51. private $eanVirtual;
  52. /**
  53. * @var string|null
  54. *
  55. * @ORM\Column(name="reference", type="string", length=32, nullable=true)
  56. */
  57. private $sku;
  58. /**
  59. * @var bool
  60. *
  61. * @ORM\Column(name="default_on", type="boolean", options={"default" : 0})
  62. */
  63. private $defaultOn;
  64. /**
  65. * @var string|null
  66. *
  67. * @ORM\Column(name="supplier_reference", type="string", length=32, nullable=true)
  68. */
  69. private $supplier;
  70. /**
  71. * @var Product
  72. *
  73. * @ORM\ManyToOne(targetEntity="App\Entity\System\Product", inversedBy="productAttributes", cascade={"persist"})
  74. *
  75. * @ORM\JoinColumn(name="id_product", referencedColumnName="id_product", nullable=false)
  76. */
  77. private $product;
  78. /**
  79. * @var Collection<int, IncomingStock>
  80. *
  81. * @ORM\OneToMany(targetEntity="App\Entity\System\IncomingStock", mappedBy="productAttribute")
  82. */
  83. private $incommingStocks;
  84. /**
  85. * @var ProductPrice|null
  86. *
  87. * @ORM\OneToOne(targetEntity="ProductPrice", mappedBy="productAttribute", cascade={"persist"})
  88. */
  89. private $productPrice;
  90. /**
  91. * @var float
  92. *
  93. * @ORM\Column(name="height", type="float", nullable=false, options={"default" : 0})
  94. */
  95. private float $height;
  96. /**
  97. * @ORM\Column(name="weight", type="float", nullable=false, options={"default" : 0})
  98. */
  99. private float $weight;
  100. /**
  101. * @ORM\Column(name="width", type="float", nullable=false, options={"default" : 0})
  102. */
  103. private float $width;
  104. /**
  105. * @ORM\Column(name="depth", type="float", nullable=false, options={"default" : 0})
  106. */
  107. private float $depth;
  108. /**
  109. * @var int
  110. *
  111. * @ORM\Column(name="palet", type="integer", options={"default" : 0})
  112. */
  113. private $palletUnits;
  114. /**
  115. * @var int
  116. *
  117. * @ORM\Column(name="position", type="integer", options={"default" : 1})
  118. */
  119. private $position;
  120. /**
  121. * @var int
  122. *
  123. * @ORM\Column(name="box", type="integer", options={"default" : 0})
  124. */
  125. private $boxUnits;
  126. /**
  127. * @ORM\Column(type="string", length=1)
  128. */
  129. private string $logisticClass;
  130. /**
  131. * @var ProductDate|null
  132. *
  133. * @ORM\OneToOne(targetEntity="App\Entity\System\ProductDate", mappedBy="productAttribute")
  134. */
  135. private $productDate;
  136. /**
  137. * @var StockAvailable|null
  138. *
  139. * @ORM\OneToOne(targetEntity="StockAvailable", mappedBy="productAttribute", cascade={"persist", "remove"})
  140. */
  141. private $stock;
  142. /**
  143. * @var Collection<int, FutureStock>&iterable<FutureStock>
  144. *
  145. * @ORM\OneToMany(targetEntity="FutureStock", mappedBy="productAttribute", cascade={"persist", "remove"})
  146. */
  147. private $futureStocks;
  148. /**
  149. * @var Collection<int, MinimumOrderQuantity>
  150. *
  151. * @ORM\OneToMany(targetEntity="MinimumOrderQuantity", mappedBy="productAttribute", cascade={"persist", "remove"})
  152. */
  153. private $minimumOrderQuantitys;
  154. /**
  155. * @var Collection<int, Attribute>
  156. *
  157. * @ORM\ManyToMany(targetEntity="App\Entity\System\Attribute")
  158. *
  159. * @ORM\JoinTable(
  160. * name="ps_product_attribute_combination",
  161. * joinColumns={@ORM\JoinColumn(name="id_product_attribute", referencedColumnName="id_product_attribute", fieldName="id")},
  162. * inverseJoinColumns={@ORM\JoinColumn(name="id_attribute", referencedColumnName="id_attribute", fieldName="id")}
  163. * )
  164. */
  165. private Collection $attributes;
  166. /**
  167. * @ORM\Column(name="buybox", type="boolean", options={"default" : 0})
  168. */
  169. private bool $buyBox;
  170. /**
  171. * @ORM\Column(type="string", length=128, nullable=true)
  172. */
  173. private ?string $partNumber = null;
  174. /**
  175. * * @ORM\Column(type="float", nullable=true)
  176. */
  177. private ?float $canon = null;
  178. /**
  179. * @deprecated
  180. *
  181. * @ORM\Column(type="string", length=64, nullable=true)
  182. */
  183. private ?string $location = null;
  184. /**
  185. * @deprecated
  186. *
  187. * @ORM\Column(type="string", length=12, nullable=true)
  188. */
  189. private ?string $upc = null;
  190. /**
  191. * @deprecated
  192. *
  193. * @ORM\Column(type="float", nullable=true, options={"default" : 0})
  194. */
  195. private ?float $ecotax = null;
  196. /**
  197. * @deprecated
  198. *
  199. * @ORM\Column(type="integer", nullable=true, options={"default" : 0})
  200. */
  201. private ?int $quantity = null;
  202. /**
  203. * @deprecated
  204. *
  205. * @ORM\Column(type="integer", nullable=true, options={"default" : 1})
  206. */
  207. private ?int $minimalQuantity = null;
  208. /**
  209. * @deprecated
  210. *
  211. * @ORM\Column(type="datetime", nullable=true)
  212. */
  213. private ?\DateTime $availableDate = null;
  214. /**
  215. * @deprecated
  216. *
  217. * @ORM\Column(type="string", length=50, nullable=true)
  218. */
  219. private ?string $picking = null;
  220. /**
  221. * @deprecated
  222. *
  223. * @ORM\Column(type="string", length=50, nullable=true)
  224. */
  225. private ?string $locationPalet1 = null;
  226. /**
  227. * @deprecated
  228. *
  229. * @ORM\Column(type="string", length=50, nullable=true)
  230. */
  231. private ?string $locationPalet2 = null;
  232. /**
  233. * @deprecated
  234. *
  235. * @ORM\Column(type="datetime", nullable=true)
  236. */
  237. private ?\DateTime $dateAdd = null;
  238. /**
  239. * @deprecated
  240. *
  241. * @ORM\Column(type="datetime", nullable=true)
  242. */
  243. private ?\DateTime $dateUpd = null;
  244. /**
  245. * @deprecated
  246. *
  247. * @ORM\Column(type="integer", nullable=true, options={"default" : 0})
  248. */
  249. private ?int $container_20p = null;
  250. /**
  251. * @deprecated
  252. *
  253. * @ORM\Column(type="integer", nullable=true, options={"default" : 0})
  254. */
  255. private ?int $container_40p = null;
  256. /**
  257. * @deprecated
  258. *
  259. * @ORM\Column(type="datetime", nullable=true)
  260. */
  261. private ?\DateTime $dateNext = null;
  262. /**
  263. * @deprecated
  264. *
  265. * @ORM\Column(type="integer", nullable=true)
  266. */
  267. private ?int $delay = null;
  268. /**
  269. * @deprecated
  270. *
  271. * @ORM\Column(type="integer", nullable=true)
  272. */
  273. private ?int $idProductAttributeCompras = null;
  274. /**
  275. * @ORM\Column(type="datetime", nullable=true)
  276. */
  277. private ?\DateTime $dateDisabled = null;
  278. /**
  279. * ProductAttribute constructor.
  280. */
  281. public function __construct()
  282. {
  283. $this->minimumOrderQuantitys = new ArrayCollection();
  284. $this->attributes = new ArrayCollection();
  285. $this->buyBox = false;
  286. }
  287. public function getId(): int
  288. {
  289. return $this->id;
  290. }
  291. public function setId(int $id): ProductAttribute
  292. {
  293. $this->id = $id;
  294. return $this;
  295. }
  296. public function getEan(): ?string
  297. {
  298. return $this->ean;
  299. }
  300. public function setEan(?string $ean): ProductAttribute
  301. {
  302. $this->ean = $ean;
  303. return $this;
  304. }
  305. public function getEanVirtual(): ?string
  306. {
  307. return $this->eanVirtual;
  308. }
  309. public function setEanVirtual(?string $eanVirtual): ProductAttribute
  310. {
  311. $this->eanVirtual = $eanVirtual;
  312. return $this;
  313. }
  314. public function getSku(): ?string
  315. {
  316. return $this->sku;
  317. }
  318. public function setSku(?string $sku): ProductAttribute
  319. {
  320. $this->sku = $sku;
  321. return $this;
  322. }
  323. public function isDefaultOn(): bool
  324. {
  325. return $this->defaultOn;
  326. }
  327. public function setDefaultOn(bool $defaultOn): ProductAttribute
  328. {
  329. $this->defaultOn = $defaultOn;
  330. return $this;
  331. }
  332. public function getSupplier(): ?string
  333. {
  334. return $this->supplier;
  335. }
  336. public function setSupplier(?string $supplier): ProductAttribute
  337. {
  338. $this->supplier = $supplier;
  339. return $this;
  340. }
  341. public function getProduct(): Product
  342. {
  343. return $this->product;
  344. }
  345. public function setProduct(Product $product): ProductAttribute
  346. {
  347. $this->product = $product;
  348. return $this;
  349. }
  350. public function getHeight(): float
  351. {
  352. return $this->height;
  353. }
  354. public function setHeight(float $height): ProductAttribute
  355. {
  356. $this->height = $height;
  357. return $this;
  358. }
  359. public function getWeight(): float
  360. {
  361. return $this->weight;
  362. }
  363. public function setWeight(float $weight): ProductAttribute
  364. {
  365. $this->weight = $weight;
  366. return $this;
  367. }
  368. public function getWidth(): float
  369. {
  370. return $this->width;
  371. }
  372. public function setWidth(float $width): ProductAttribute
  373. {
  374. $this->width = $width;
  375. return $this;
  376. }
  377. public function getDepth(): float
  378. {
  379. return $this->depth;
  380. }
  381. public function setDepth(float $depth): ProductAttribute
  382. {
  383. $this->depth = $depth;
  384. return $this;
  385. }
  386. public function getPalletUnits(): int
  387. {
  388. return $this->palletUnits;
  389. }
  390. public function setPalletUnits(int $palletUnits): ProductAttribute
  391. {
  392. $this->palletUnits = $palletUnits;
  393. return $this;
  394. }
  395. public function getPosition(): int
  396. {
  397. return $this->position;
  398. }
  399. public function setPosition(int $position): ProductAttribute
  400. {
  401. $this->position = $position;
  402. return $this;
  403. }
  404. public function getBoxUnits(): int
  405. {
  406. return $this->boxUnits;
  407. }
  408. public function setBoxUnits(int $boxUnits): ProductAttribute
  409. {
  410. $this->boxUnits = $boxUnits;
  411. return $this;
  412. }
  413. public function getLogisticClass(): string
  414. {
  415. return $this->logisticClass;
  416. }
  417. public function setLogisticClass(string $logisticClass): ProductAttribute
  418. {
  419. $this->logisticClass = $logisticClass;
  420. return $this;
  421. }
  422. public function getStock(): ?StockAvailable
  423. {
  424. return $this->stock;
  425. }
  426. public function setStock(StockAvailable $stock): ProductAttribute
  427. {
  428. $this->stock = $stock;
  429. return $this;
  430. }
  431. /**
  432. * @return Collection<int, MinimumOrderQuantity>
  433. */
  434. public function getMinimumOrderQuantitys(): Collection
  435. {
  436. return $this->minimumOrderQuantitys;
  437. }
  438. /**
  439. * @param Collection<int, MinimumOrderQuantity> $minimumOrderQuantitys
  440. *
  441. * @return ProductAttribute
  442. */
  443. public function setMinimumOrderQuantitys(Collection $minimumOrderQuantitys): ProductAttribute
  444. {
  445. $this->minimumOrderQuantitys = $minimumOrderQuantitys;
  446. return $this;
  447. }
  448. public function getProductDate(): ProductDate
  449. {
  450. return $this->productDate;
  451. }
  452. public function setProductDate(ProductDate $productDate): ProductAttribute
  453. {
  454. $this->productDate = $productDate;
  455. return $this;
  456. }
  457. public function isBuyBox(): bool
  458. {
  459. return $this->buyBox;
  460. }
  461. public function setBuyBox(bool $buyBox): ProductAttribute
  462. {
  463. $this->buyBox = $buyBox;
  464. return $this;
  465. }
  466. public function getPartNumber(): ?string
  467. {
  468. return $this->partNumber;
  469. }
  470. public function setPartNumber(?string $partNumber): ProductAttribute
  471. {
  472. $this->partNumber = $partNumber;
  473. return $this;
  474. }
  475. public function getCanon(): ?float
  476. {
  477. return $this->canon;
  478. }
  479. public function setCanon(?float $canon): ProductAttribute
  480. {
  481. $this->canon = $canon;
  482. return $this;
  483. }
  484. /**
  485. * @return Collection<int, Attribute>
  486. */
  487. public function getAttributes(): Collection
  488. {
  489. return $this->attributes;
  490. }
  491. /**
  492. * @param Collection<int, Attribute> $attributes
  493. */
  494. public function setAttributes(Collection $attributes): ProductAttribute
  495. {
  496. $this->attributes = $attributes;
  497. return $this;
  498. }
  499. /**
  500. * @return Collection<int, FutureStock>&iterable<FutureStock>
  501. */
  502. public function getFutureStocks()
  503. {
  504. return $this->futureStocks;
  505. }
  506. /**
  507. * @param Collection<int, FutureStock>&iterable<FutureStock> $futureStocks
  508. */
  509. public function setFutureStocks($futureStocks): ProductAttribute
  510. {
  511. $this->futureStocks = $futureStocks;
  512. return $this;
  513. }
  514. public function getDateDisabled(): ?\DateTime
  515. {
  516. return $this->dateDisabled;
  517. }
  518. public function setDateDisabled(?\DateTime $dateDisabled): ProductAttribute
  519. {
  520. $this->dateDisabled = $dateDisabled;
  521. return $this;
  522. }
  523. /**
  524. * @return Collection<int, IncomingStock>
  525. */
  526. public function getIncommingStocks()
  527. {
  528. return $this->incommingStocks;
  529. }
  530. /**
  531. * @param Collection<int, IncomingStock> $incommingStocks
  532. */
  533. public function setIncommingStocks(Collection $incommingStocks): ProductAttribute
  534. {
  535. $this->incommingStocks = $incommingStocks;
  536. return $this;
  537. }
  538. public function getProductPrice(): ?ProductPrice
  539. {
  540. return $this->productPrice;
  541. }
  542. public function setProductPrice(ProductPrice $productPrice): ProductAttribute
  543. {
  544. $this->productPrice = $productPrice;
  545. return $this;
  546. }
  547. }