src/Entity/Idempiere/MProduct.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Idempiere;
  3. use App\Entity\Idempiere\MaterialManagement\Reservation;
  4. use App\Entity\Idempiere\MaterialManagement\StorageOnHand;
  5. use App\Repository\Idempiere\MProductRepository;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\Common\Collections\Collection;
  8. use Doctrine\ORM\Mapping as ORM;
  9. /**
  10. * @ORM\Entity(repositoryClass=MProductRepository::class)
  11. * @ORM\Table(name="M_Product")
  12. */
  13. class MProduct
  14. {
  15. /**
  16. * @ORM\Id
  17. * @ORM\Column(type="integer")
  18. */
  19. private $m_product_id;
  20. /**
  21. * @ORM\Column(type="integer")
  22. */
  23. private $ad_client_id;
  24. /**
  25. * @ORM\Column(type="integer")
  26. */
  27. private $ad_org_id;
  28. /**
  29. * @ORM\Column(type="string", length=255)
  30. */
  31. private $name;
  32. /**
  33. * @ORM\Column(type="string", length=1000)
  34. */
  35. private $description;
  36. /**
  37. * @ORM\ManyToOne(targetEntity=SmMarca::class, inversedBy="m_product")
  38. * @ORM\JoinColumn(referencedColumnName="sm_marca_id", nullable=false)
  39. */
  40. private $sm_marca;
  41. /**
  42. * @ORM\Column(type="integer")
  43. */
  44. private $sm_marca_id;
  45. /**
  46. * @ORM\Column(type="string", length=255)
  47. */
  48. private $sku;
  49. /**
  50. * @ORM\Column(type="string", length=255)
  51. */
  52. private $value;
  53. /**
  54. * @ORM\ManyToOne(targetEntity=MProductCategory::class, inversedBy="m_product")
  55. * @ORM\JoinColumn(referencedColumnName="m_product_category_id", nullable=false)
  56. */
  57. private $m_product_category;
  58. /**
  59. * @ORM\Column(type="integer")
  60. */
  61. private $m_product_category_id;
  62. /**
  63. * @ORM\Column(type="string", length=1)
  64. */
  65. private $isactive;
  66. /**
  67. * @ORM\Column(type="string", length=1)
  68. */
  69. private $issold;
  70. /**
  71. * @ORM\OneToMany(targetEntity=MProductdownload::class, mappedBy="m_product")
  72. * @ORM\OrderBy({"seqno": "ASC"})
  73. */
  74. private $m_productdownload;
  75. /**
  76. * @ORM\ManyToOne(targetEntity=SmModeloProducto::class)
  77. * @ORM\JoinColumn(referencedColumnName="sm_modelo_producto_id", nullable=false)
  78. */
  79. private $sm_modelo_producto;
  80. /**
  81. * @ORM\Column(type="integer")
  82. */
  83. private $sm_modelo_producto_id;
  84. /**
  85. * @ORM\Column(type="datetime")
  86. */
  87. private $created;
  88. /**
  89. * @ORM\ManyToOne(targetEntity=AdUser::class)
  90. * @ORM\JoinColumn(name="createdby", referencedColumnName="ad_user_id", nullable=false)
  91. */
  92. private $ad_user;
  93. /**
  94. * @ORM\Column(type="integer")
  95. */
  96. private $createdby;
  97. /**
  98. * @ORM\Column(type="datetime")
  99. */
  100. private $updated;
  101. /**
  102. * @ORM\Column(type="integer")
  103. */
  104. private $updatedby;
  105. /**
  106. * @ORM\OneToMany(targetEntity=MProductprice::class, mappedBy="m_product")
  107. */
  108. private $m_productprices;
  109. private $price;
  110. /**
  111. * @ORM\Column(type="integer")
  112. */
  113. private $c_taxcategory_id;
  114. /**
  115. * @ORM\Column(type="integer")
  116. */
  117. private $c_uom_id;
  118. /**
  119. * @ORM\Column(type="string", length=1)
  120. */
  121. private $issummary;
  122. /**
  123. * @ORM\Column(type="string", length=2500, nullable=true)
  124. */
  125. private $allegation;
  126. /**
  127. * @ORM\Column(type="integer", nullable=true)
  128. */
  129. private $sm_characteristicset_id;
  130. /**
  131. * @ORM\ManyToOne(targetEntity=SmCharacteristicset::class)
  132. * @ORM\JoinColumn(referencedColumnName="sm_characteristicset_id")
  133. */
  134. private $sm_characteristicset;
  135. /**
  136. * @ORM\Column(type="integer", nullable=true)
  137. */
  138. private $m_attributeset_id;
  139. /**
  140. * @ORM\ManyToOne(targetEntity=MAttributeset::class)
  141. * @ORM\JoinColumn(referencedColumnName="m_attributeset_id")
  142. */
  143. private $m_attributeset;
  144. /**
  145. * @ORM\Column(type="string", length=250, nullable=true)
  146. */
  147. private $comercialname;
  148. /**
  149. * @ORM\Column(type="integer", nullable=true)
  150. */
  151. private $m_attributesetinstance_id;
  152. /**
  153. * @ORM\OneToOne(targetEntity=MAttributesetinstance::class, cascade={"persist", "remove"})
  154. * @ORM\JoinColumn(referencedColumnName="m_attributesetinstance_id")
  155. */
  156. private $m_attributesetinstance;
  157. /**
  158. * @ORM\OneToMany(targetEntity=SmMPromotionprecondition::class, mappedBy="m_product")
  159. */
  160. private $sm_m_promotionprecondition;
  161. /**
  162. * @ORM\OneToMany(targetEntity=SmUserProductaccess::class, mappedBy="m_product")
  163. */
  164. private $sm_user_productaccesses;
  165. /**
  166. * @ORM\OneToMany(targetEntity=SmFichaTecnica::class, mappedBy="m_product")
  167. */
  168. private $sm_fichas_tecnicas;
  169. /**
  170. * @ORM\OneToMany(targetEntity=SmPrecioEstimadoline::class, mappedBy="m_product")
  171. */
  172. private $sm_precios_estimadolines;
  173. /**
  174. * @ORM\Column(type="string", length=1)
  175. */
  176. private $iswebstorefeatured;
  177. /**
  178. * @ORM\OneToMany(targetEntity=StorageOnHand::class, mappedBy="product")
  179. */
  180. private $storagesOnHand;
  181. /**
  182. * @ORM\OneToMany(targetEntity=Reservation::class, mappedBy="product")
  183. */
  184. private $reservationList;
  185. /**
  186. * @ORM\Column(type="string", length=1, nullable=true)
  187. */
  188. private $discontinued;
  189. public function __construct()
  190. {
  191. $this->m_productdownload = new ArrayCollection();
  192. $this->m_productprices = new ArrayCollection();
  193. $this->sm_m_promotionprecondition = new ArrayCollection();
  194. $this->sm_user_productaccesses = new ArrayCollection();
  195. $this->sm_fichas_tecnicas = new ArrayCollection();
  196. $this->sm_precios_estimadolines = new ArrayCollection();
  197. $this->storagesOnHand = new ArrayCollection();
  198. }
  199. public function getId(): ?int
  200. {
  201. return $this->getMProductId();
  202. }
  203. public function getAdClientId(): ?int
  204. {
  205. return $this->ad_client_id;
  206. }
  207. public function setAdClientId(int $ad_client_id): self
  208. {
  209. $this->ad_client_id = $ad_client_id;
  210. return $this;
  211. }
  212. public function getAdOrgId(): ?int
  213. {
  214. return $this->ad_org_id;
  215. }
  216. public function setAdOrgId(int $ad_org_id): self
  217. {
  218. $this->ad_org_id = $ad_org_id;
  219. return $this;
  220. }
  221. public function getMProductId(): ?int
  222. {
  223. return $this->m_product_id;
  224. }
  225. public function setMProductId(int $m_product_id): self
  226. {
  227. $this->m_product_id = $m_product_id;
  228. return $this;
  229. }
  230. public function getName(): ?string
  231. {
  232. return $this->name;
  233. }
  234. public function setName(string $name): self
  235. {
  236. $this->name = $name;
  237. return $this;
  238. }
  239. public function getDescription(): ?string
  240. {
  241. return $this->description;
  242. }
  243. public function setDescription(string $description): self
  244. {
  245. $this->description = $description;
  246. return $this;
  247. }
  248. public function getSku(): ?string
  249. {
  250. return $this->sku;
  251. }
  252. public function setSku(string $sku): self
  253. {
  254. $this->sku = $sku;
  255. return $this;
  256. }
  257. public function getValue(): ?string
  258. {
  259. return $this->value;
  260. }
  261. public function setValue(string $value): self
  262. {
  263. $this->value = $value;
  264. return $this;
  265. }
  266. public function getSmMarca(): ?SmMarca
  267. {
  268. return $this->sm_marca;
  269. }
  270. public function setSmMarca(?SmMarca $sm_marca): self
  271. {
  272. $this->sm_marca = $sm_marca;
  273. return $this;
  274. }
  275. public function getSmMarcaId(): ?int
  276. {
  277. return $this->sm_marca_id;
  278. }
  279. public function setSmMarcaId(int $sm_marca_id): self
  280. {
  281. $this->sm_marca_id = $sm_marca_id;
  282. return $this;
  283. }
  284. public function getMProductCategory(): ?MProductCategory
  285. {
  286. return $this->m_product_category;
  287. }
  288. public function setMProductCategory(?MProductCategory $m_product_category): self
  289. {
  290. $this->m_product_category = $m_product_category;
  291. return $this;
  292. }
  293. public function getMProductCategoryId(): ?int
  294. {
  295. return $this->m_product_category_id;
  296. }
  297. public function setMProductCategoryId(int $m_product_category_id): self
  298. {
  299. $this->m_product_category_id = $m_product_category_id;
  300. return $this;
  301. }
  302. public function isActive(): ?bool
  303. {
  304. return $this->getIsactive() === "Y";
  305. }
  306. public function getIsactive(): ?string
  307. {
  308. return $this->isactive;
  309. }
  310. public function setIsactive(string $isactive): self
  311. {
  312. $this->isactive = $isactive;
  313. return $this;
  314. }
  315. public function getIssold(): ?string
  316. {
  317. return $this->issold;
  318. }
  319. public function setIssold(string $issold): self
  320. {
  321. $this->issold = $issold;
  322. return $this;
  323. }
  324. /**
  325. * @return Collection|MProductdownload[]
  326. */
  327. public function getMProductdownload(): Collection
  328. {
  329. return $this->m_productdownload;
  330. }
  331. public function addMProductdownload(MProductdownload $mProductdownload): self
  332. {
  333. if (!$this->m_productdownload->contains($mProductdownload)) {
  334. $this->m_productdownload[] = $mProductdownload;
  335. $mProductdownload->setMProduct($this);
  336. }
  337. return $this;
  338. }
  339. public function removeMProductdownload(MProductdownload $mProductdownload): self
  340. {
  341. if ($this->m_productdownload->removeElement($mProductdownload)) {
  342. // set the owning side to null (unless already changed)
  343. if ($mProductdownload->getMProduct() === $this) {
  344. $mProductdownload->setMProduct(null);
  345. }
  346. }
  347. return $this;
  348. }
  349. public function getSmModeloProducto(): ?SmModeloProducto
  350. {
  351. return $this->sm_modelo_producto;
  352. }
  353. public function setSmModeloProducto(?SmModeloProducto $sm_modelo_producto): self
  354. {
  355. $this->sm_modelo_producto = $sm_modelo_producto;
  356. return $this;
  357. }
  358. public function getSmModeloProductoId(): ?int
  359. {
  360. return $this->sm_modelo_producto_id;
  361. }
  362. public function setSmModeloProductoId(int $sm_modelo_producto_id): self
  363. {
  364. $this->sm_modelo_producto_id = $sm_modelo_producto_id;
  365. return $this;
  366. }
  367. public function getCreated(): ?\DateTimeInterface
  368. {
  369. return $this->created;
  370. }
  371. public function setCreated(\DateTimeInterface $created): self
  372. {
  373. $this->created = $created;
  374. return $this;
  375. }
  376. public function getAdUser(): ?AdUser
  377. {
  378. return $this->ad_user;
  379. }
  380. public function setAdUser(?AdUser $ad_user): self
  381. {
  382. $this->ad_user = $ad_user;
  383. return $this;
  384. }
  385. public function getCreatedby(): ?int
  386. {
  387. return $this->createdby;
  388. }
  389. public function setCreatedby(int $createdby): self
  390. {
  391. $this->createdby = $createdby;
  392. return $this;
  393. }
  394. public function getUpdated(): ?\DateTimeInterface
  395. {
  396. return $this->updated;
  397. }
  398. public function setUpdated(\DateTimeInterface $updated): self
  399. {
  400. $this->updated = $updated;
  401. return $this;
  402. }
  403. public function getUpdatedby(): ?int
  404. {
  405. return $this->updatedby;
  406. }
  407. public function setUpdatedby(int $updatedby): self
  408. {
  409. $this->updatedby = $updatedby;
  410. return $this;
  411. }
  412. /**
  413. * @return Collection|MProductprice[]
  414. */
  415. public function getMProductprices(): Collection
  416. {
  417. return $this->m_productprices;
  418. }
  419. public function addMProductprice(MProductprice $mProductprice): self
  420. {
  421. if (!$this->m_productprices->contains($mProductprice)) {
  422. $this->m_productprices[] = $mProductprice;
  423. $mProductprice->setMProduct($this);
  424. }
  425. return $this;
  426. }
  427. public function removeMProductprice(MProductprice $mProductprice): self
  428. {
  429. if ($this->m_productprices->removeElement($mProductprice)) {
  430. // set the owning side to null (unless already changed)
  431. if ($mProductprice->getMProduct() === $this) {
  432. $mProductprice->setMProduct(null);
  433. }
  434. }
  435. return $this;
  436. }
  437. public function getPrice (): float
  438. {
  439. return $this->price ?: 0;
  440. }
  441. public function setPrice(float $price): self
  442. {
  443. $this->price = $price;
  444. return $this;
  445. }
  446. public function getCTaxcategoryId(): ?int
  447. {
  448. return $this->c_taxcategory_id;
  449. }
  450. public function setCTaxcategoryId(int $c_taxcategory_id): self
  451. {
  452. $this->c_taxcategory_id = $c_taxcategory_id;
  453. return $this;
  454. }
  455. public function getCUomId(): ?int
  456. {
  457. return $this->c_uom_id;
  458. }
  459. public function setCUomId(int $c_uom_id): self
  460. {
  461. $this->c_uom_id = $c_uom_id;
  462. return $this;
  463. }
  464. public function getIssummary(): ?string
  465. {
  466. return $this->issummary;
  467. }
  468. public function setIssummary(string $issummary): self
  469. {
  470. $this->issummary = $issummary;
  471. return $this;
  472. }
  473. public function getAllegation(): ?string
  474. {
  475. return $this->allegation;
  476. }
  477. public function setAllegation(?string $allegation): self
  478. {
  479. $this->allegation = $allegation;
  480. return $this;
  481. }
  482. public function getSmCharacteristicsetId(): ?int
  483. {
  484. return $this->sm_characteristicset_id;
  485. }
  486. public function setSmCharacteristicsetId(int $sm_characteristicset_id): self
  487. {
  488. $this->sm_characteristicset_id = $sm_characteristicset_id;
  489. return $this;
  490. }
  491. public function getSmCharacteristicset(): ?SmCharacteristicset
  492. {
  493. return $this->sm_characteristicset;
  494. }
  495. public function setSmCharacteristicset(?SmCharacteristicset $sm_characteristicset): self
  496. {
  497. $this->sm_characteristicset = $sm_characteristicset;
  498. return $this;
  499. }
  500. public function getMAttributesetId(): ?int
  501. {
  502. return $this->m_attributeset_id;
  503. }
  504. public function setMAttributesetId(?int $m_attributeset_id): self
  505. {
  506. $this->m_attributeset_id = $m_attributeset_id;
  507. return $this;
  508. }
  509. public function getMAttributeset(): ?MAttributeset
  510. {
  511. return $this->m_attributeset;
  512. }
  513. public function setMAttributeset(?MAttributeset $m_attributeset): self
  514. {
  515. $this->m_attributeset = $m_attributeset;
  516. return $this;
  517. }
  518. public function getComercialname(): ?string
  519. {
  520. return $this->comercialname;
  521. }
  522. public function setComercialname(?string $comercialname): self
  523. {
  524. $this->comercialname = $comercialname;
  525. return $this;
  526. }
  527. public function getMAttributesetinstanceId(): ?int
  528. {
  529. return $this->m_attributesetinstance_id;
  530. }
  531. public function setMAttributesetinstanceId(?int $m_attributesetinstance_id): self
  532. {
  533. $this->m_attributesetinstance_id = $m_attributesetinstance_id;
  534. return $this;
  535. }
  536. public function getMAttributesetinstance(): ?MAttributesetinstance
  537. {
  538. return $this->m_attributesetinstance;
  539. }
  540. public function setMAttributesetinstance(?MAttributesetinstance $m_attributesetinstance): self
  541. {
  542. $this->m_attributesetinstance = $m_attributesetinstance;
  543. return $this;
  544. }
  545. /**
  546. * @return Collection<int, SmMPromotionprecondition>
  547. */
  548. public function getSmMPromotionpreconditions(): Collection
  549. {
  550. return $this->sm_m_promotionprecondition;
  551. }
  552. /**
  553. * @return Collection<int, SmUserProductaccess>
  554. */
  555. public function getSmUserProductaccess(): Collection
  556. {
  557. return $this->sm_user_productaccesses;
  558. }
  559. /**
  560. * @return Collection<int, SmFichaTecnica>
  561. */
  562. public function getSmFichasTecnicas(): Collection
  563. {
  564. return $this->sm_fichas_tecnicas;
  565. }
  566. public function addSmFichasTecnica(SmFichaTecnica $smFichasTecnica): self
  567. {
  568. if (!$this->sm_fichas_tecnicas->contains($smFichasTecnica)) {
  569. $this->sm_fichas_tecnicas[] = $smFichasTecnica;
  570. $smFichasTecnica->setMProduct($this);
  571. }
  572. return $this;
  573. }
  574. public function removeSmFichasTecnica(SmFichaTecnica $smFichasTecnica): self
  575. {
  576. if ($this->sm_fichas_tecnicas->removeElement($smFichasTecnica)) {
  577. // set the owning side to null (unless already changed)
  578. if ($smFichasTecnica->getMProduct() === $this) {
  579. $smFichasTecnica->setMProduct(null);
  580. }
  581. }
  582. return $this;
  583. }
  584. /**
  585. * @return Collection<int, SmPrecioEstimadoline>
  586. */
  587. public function getSmPreciosEstimadolines(): Collection
  588. {
  589. return $this->sm_precios_estimadolines;
  590. }
  591. public function getIswebstorefeatured(): ?string
  592. {
  593. return $this->iswebstorefeatured;
  594. }
  595. public function setIswebstorefeatured(string $iswebstorefeatured): self
  596. {
  597. $this->iswebstorefeatured = $iswebstorefeatured;
  598. return $this;
  599. }
  600. /**
  601. * @return Collection|StorageOnHand[]
  602. */
  603. public function getStoragesOnHand(): Collection
  604. {
  605. return $this->storagesOnHand;
  606. }
  607. /**
  608. * @return Collection|Reservation[]
  609. */
  610. public function getReservationList(): Collection
  611. {
  612. return $this->reservationList;
  613. }
  614. }