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 ProductPrice|null
  80. *
  81. * @ORM\OneToOne(targetEntity="ProductPrice", mappedBy="productAttribute", cascade={"persist"})
  82. */
  83. private $productPrice;
  84. /**
  85. * @var float
  86. *
  87. * @ORM\Column(name="height", type="float", nullable=false, options={"default" : 0})
  88. */
  89. private float $height;
  90. /**
  91. * @ORM\Column(name="weight", type="float", nullable=false, options={"default" : 0})
  92. */
  93. private float $weight;
  94. /**
  95. * @ORM\Column(name="width", type="float", nullable=false, options={"default" : 0})
  96. */
  97. private float $width;
  98. /**
  99. * @ORM\Column(name="depth", type="float", nullable=false, options={"default" : 0})
  100. */
  101. private float $depth;
  102. /**
  103. * @var int
  104. *
  105. * @ORM\Column(name="palet", type="integer", options={"default" : 0})
  106. */
  107. private $palletUnits;
  108. /**
  109. * @var int
  110. *
  111. * @ORM\Column(name="position", type="integer", options={"default" : 1})
  112. */
  113. private $position;
  114. /**
  115. * @var int
  116. *
  117. * @ORM\Column(name="box", type="integer", options={"default" : 0})
  118. */
  119. private $boxUnits;
  120. /**
  121. * @ORM\Column(type="string", length=1)
  122. */
  123. private string $logisticClass;
  124. /**
  125. * @var ProductDate|null
  126. *
  127. * @ORM\OneToOne(targetEntity="App\Entity\System\ProductDate", mappedBy="productAttribute")
  128. */
  129. private $productDate;
  130. /**
  131. * @var Collection<int, ProductStock>
  132. *
  133. * @ORM\OneToMany(targetEntity="ProductStock", mappedBy="productAttribute", cascade={"persist", "remove"})
  134. */
  135. private $productStocks;
  136. /**
  137. * @var Collection<int, OrderDetail>
  138. *
  139. * @ORM\OneToMany(targetEntity="App\Entity\System\OrderDetail", mappedBy="productAttribute")
  140. */
  141. private $orderDetails;
  142. /**
  143. * @var Collection<int, CartProduct>
  144. *
  145. * @ORM\OneToMany(targetEntity="App\Entity\System\CartProduct", mappedBy="productAttribute")
  146. */
  147. private $cartProducts;
  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=12, nullable=true)
  182. */
  183. private ?string $upc = null;
  184. /**
  185. * @deprecated
  186. *
  187. * @ORM\Column(type="float", nullable=true, options={"default" : 0})
  188. */
  189. private ?float $ecotax = null;
  190. /**
  191. * @deprecated
  192. *
  193. * @ORM\Column(type="integer", nullable=true, options={"default" : 0})
  194. */
  195. private ?int $quantity = null;
  196. /**
  197. * @deprecated
  198. *
  199. * @ORM\Column(type="integer", nullable=true, options={"default" : 1})
  200. */
  201. private ?int $minimalQuantity = null;
  202. /**
  203. * @deprecated
  204. *
  205. * @ORM\Column(type="datetime", nullable=true)
  206. */
  207. private ?\DateTime $availableDate = null;
  208. /**
  209. * @deprecated
  210. *
  211. * @ORM\Column(type="string", length=50, nullable=true)
  212. */
  213. private ?string $picking = null;
  214. /**
  215. * @deprecated
  216. *
  217. * @ORM\Column(type="datetime", nullable=true)
  218. */
  219. private ?\DateTime $dateAdd = null;
  220. /**
  221. * @deprecated
  222. *
  223. * @ORM\Column(type="datetime", nullable=true)
  224. */
  225. private ?\DateTime $dateUpd = null;
  226. /**
  227. * @deprecated
  228. *
  229. * @ORM\Column(type="integer", nullable=true, options={"default" : 0})
  230. */
  231. private ?int $container_20p = null;
  232. /**
  233. * @deprecated
  234. *
  235. * @ORM\Column(type="integer", nullable=true, options={"default" : 0})
  236. */
  237. private ?int $container_40p = null;
  238. /**
  239. * @deprecated
  240. *
  241. * @ORM\Column(type="datetime", nullable=true)
  242. */
  243. private ?\DateTime $dateNext = null;
  244. /**
  245. * @deprecated
  246. *
  247. * @ORM\Column(type="integer", nullable=true)
  248. */
  249. private ?int $delay = null;
  250. /**
  251. * @deprecated
  252. *
  253. * @ORM\Column(type="integer", nullable=true)
  254. */
  255. private ?int $idProductAttributeCompras = null;
  256. /**
  257. * @ORM\Column(type="datetime", nullable=true)
  258. */
  259. private ?\DateTime $dateDisabled = null;
  260. /**
  261. * ProductAttribute constructor.
  262. */
  263. public function __construct()
  264. {
  265. $this->minimumOrderQuantitys = new ArrayCollection();
  266. $this->orderDetails = new ArrayCollection();
  267. $this->cartProducts = new ArrayCollection();
  268. $this->attributes = new ArrayCollection();
  269. $this->buyBox = false;
  270. }
  271. public function getId(): int
  272. {
  273. return $this->id;
  274. }
  275. public function setId(int $id): ProductAttribute
  276. {
  277. $this->id = $id;
  278. return $this;
  279. }
  280. public function getEan(): ?string
  281. {
  282. return $this->ean;
  283. }
  284. public function setEan(?string $ean): ProductAttribute
  285. {
  286. $this->ean = $ean;
  287. return $this;
  288. }
  289. public function getEanVirtual(): ?string
  290. {
  291. return $this->eanVirtual;
  292. }
  293. public function setEanVirtual(?string $eanVirtual): ProductAttribute
  294. {
  295. $this->eanVirtual = $eanVirtual;
  296. return $this;
  297. }
  298. public function getSku(): string
  299. {
  300. return $this->sku;
  301. }
  302. public function setSku(string $sku): ProductAttribute
  303. {
  304. $this->sku = $sku;
  305. return $this;
  306. }
  307. public function isDefaultOn(): bool
  308. {
  309. return $this->defaultOn;
  310. }
  311. public function setDefaultOn(bool $defaultOn): ProductAttribute
  312. {
  313. $this->defaultOn = $defaultOn;
  314. return $this;
  315. }
  316. public function getSupplier(): ?string
  317. {
  318. return $this->supplier;
  319. }
  320. public function setSupplier(?string $supplier): ProductAttribute
  321. {
  322. $this->supplier = $supplier;
  323. return $this;
  324. }
  325. public function getProduct(): Product
  326. {
  327. return $this->product;
  328. }
  329. public function setProduct(Product $product): ProductAttribute
  330. {
  331. $this->product = $product;
  332. return $this;
  333. }
  334. public function getHeight(): float
  335. {
  336. return $this->height;
  337. }
  338. public function setHeight(float $height): ProductAttribute
  339. {
  340. $this->height = $height;
  341. return $this;
  342. }
  343. public function getWeight(): float
  344. {
  345. return $this->weight;
  346. }
  347. public function setWeight(float $weight): ProductAttribute
  348. {
  349. $this->weight = $weight;
  350. return $this;
  351. }
  352. public function getWidth(): float
  353. {
  354. return $this->width;
  355. }
  356. public function setWidth(float $width): ProductAttribute
  357. {
  358. $this->width = $width;
  359. return $this;
  360. }
  361. public function getDepth(): float
  362. {
  363. return $this->depth;
  364. }
  365. public function setDepth(float $depth): ProductAttribute
  366. {
  367. $this->depth = $depth;
  368. return $this;
  369. }
  370. public function getPalletUnits(): int
  371. {
  372. return $this->palletUnits;
  373. }
  374. public function setPalletUnits(int $palletUnits): ProductAttribute
  375. {
  376. $this->palletUnits = $palletUnits;
  377. return $this;
  378. }
  379. public function getPosition(): int
  380. {
  381. return $this->position;
  382. }
  383. public function setPosition(int $position): ProductAttribute
  384. {
  385. $this->position = $position;
  386. return $this;
  387. }
  388. public function getBoxUnits(): int
  389. {
  390. return $this->boxUnits;
  391. }
  392. public function setBoxUnits(int $boxUnits): ProductAttribute
  393. {
  394. $this->boxUnits = $boxUnits;
  395. return $this;
  396. }
  397. public function getLogisticClass(): string
  398. {
  399. return $this->logisticClass;
  400. }
  401. public function setLogisticClass(string $logisticClass): ProductAttribute
  402. {
  403. $this->logisticClass = $logisticClass;
  404. return $this;
  405. }
  406. /**
  407. * @return Collection<int, MinimumOrderQuantity>
  408. */
  409. public function getMinimumOrderQuantitys(): Collection
  410. {
  411. return $this->minimumOrderQuantitys;
  412. }
  413. /**
  414. * @param Collection<int, MinimumOrderQuantity> $minimumOrderQuantitys
  415. *
  416. * @return ProductAttribute
  417. */
  418. public function setMinimumOrderQuantitys(Collection $minimumOrderQuantitys): ProductAttribute
  419. {
  420. $this->minimumOrderQuantitys = $minimumOrderQuantitys;
  421. return $this;
  422. }
  423. public function getProductDate(): ProductDate
  424. {
  425. return $this->productDate;
  426. }
  427. public function setProductDate(ProductDate $productDate): ProductAttribute
  428. {
  429. $this->productDate = $productDate;
  430. return $this;
  431. }
  432. public function isBuyBox(): bool
  433. {
  434. return $this->buyBox;
  435. }
  436. public function setBuyBox(bool $buyBox): ProductAttribute
  437. {
  438. $this->buyBox = $buyBox;
  439. return $this;
  440. }
  441. public function getPartNumber(): ?string
  442. {
  443. return $this->partNumber;
  444. }
  445. public function setPartNumber(?string $partNumber): ProductAttribute
  446. {
  447. $this->partNumber = $partNumber;
  448. return $this;
  449. }
  450. public function getCanon(): ?float
  451. {
  452. return $this->canon;
  453. }
  454. public function setCanon(?float $canon): ProductAttribute
  455. {
  456. $this->canon = $canon;
  457. return $this;
  458. }
  459. /**
  460. * @return Collection<int, Attribute>
  461. */
  462. public function getAttributes(): Collection
  463. {
  464. return $this->attributes;
  465. }
  466. /**
  467. * @param Collection<int, Attribute> $attributes
  468. */
  469. public function setAttributes(Collection $attributes): ProductAttribute
  470. {
  471. $this->attributes = $attributes;
  472. return $this;
  473. }
  474. public function getDateDisabled(): ?\DateTime
  475. {
  476. return $this->dateDisabled;
  477. }
  478. public function setDateDisabled(?\DateTime $dateDisabled): ProductAttribute
  479. {
  480. $this->dateDisabled = $dateDisabled;
  481. return $this;
  482. }
  483. public function getProductPrice(): ?ProductPrice
  484. {
  485. return $this->productPrice;
  486. }
  487. public function setProductPrice(ProductPrice $productPrice): ProductAttribute
  488. {
  489. $this->productPrice = $productPrice;
  490. return $this;
  491. }
  492. /**
  493. * @return Collection<int, ProductStock>
  494. */
  495. public function getProductStocks()
  496. {
  497. return $this->productStocks;
  498. }
  499. /**
  500. * @param Collection<int, ProductStock> $productStocks
  501. */
  502. public function setProductStocks($productStocks): ProductAttribute
  503. {
  504. $this->productStocks = $productStocks;
  505. return $this;
  506. }
  507. /**
  508. * @return Collection<int, OrderDetail>
  509. */
  510. public function getOrderDetails(): Collection
  511. {
  512. return $this->orderDetails;
  513. }
  514. /**
  515. * @param Collection<int, OrderDetail> $orderDetails
  516. */
  517. public function setOrderDetails(Collection $orderDetails): ProductAttribute
  518. {
  519. $this->orderDetails = $orderDetails;
  520. return $this;
  521. }
  522. /**
  523. * @return Collection<int, CartProduct>
  524. */
  525. public function getCartProducts(): Collection
  526. {
  527. return $this->cartProducts;
  528. }
  529. /**
  530. * @param Collection<int, CartProduct> $cartProducts
  531. */
  532. public function setCartProducts(Collection $cartProducts): ProductAttribute
  533. {
  534. $this->cartProducts = $cartProducts;
  535. return $this;
  536. }
  537. }