<?php
namespace App\Entity\Idempiere;
use App\Entity\Idempiere\MaterialManagement\Reservation;
use App\Entity\Idempiere\MaterialManagement\StorageOnHand;
use App\Repository\Idempiere\MProductRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=MProductRepository::class)
* @ORM\Table(name="M_Product")
*/
class MProduct
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
*/
private $m_product_id;
/**
* @ORM\Column(type="integer")
*/
private $ad_client_id;
/**
* @ORM\Column(type="integer")
*/
private $ad_org_id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\Column(type="string", length=1000)
*/
private $description;
/**
* @ORM\ManyToOne(targetEntity=SmMarca::class, inversedBy="m_product")
* @ORM\JoinColumn(referencedColumnName="sm_marca_id", nullable=false)
*/
private $sm_marca;
/**
* @ORM\Column(type="integer")
*/
private $sm_marca_id;
/**
* @ORM\Column(type="string", length=255)
*/
private $sku;
/**
* @ORM\Column(type="string", length=255)
*/
private $value;
/**
* @ORM\ManyToOne(targetEntity=MProductCategory::class, inversedBy="m_product")
* @ORM\JoinColumn(referencedColumnName="m_product_category_id", nullable=false)
*/
private $m_product_category;
/**
* @ORM\Column(type="integer")
*/
private $m_product_category_id;
/**
* @ORM\Column(type="string", length=1)
*/
private $isactive;
/**
* @ORM\Column(type="string", length=1)
*/
private $issold;
/**
* @ORM\OneToMany(targetEntity=MProductdownload::class, mappedBy="m_product")
* @ORM\OrderBy({"seqno": "ASC"})
*/
private $m_productdownload;
/**
* @ORM\ManyToOne(targetEntity=SmModeloProducto::class)
* @ORM\JoinColumn(referencedColumnName="sm_modelo_producto_id", nullable=false)
*/
private $sm_modelo_producto;
/**
* @ORM\Column(type="integer")
*/
private $sm_modelo_producto_id;
/**
* @ORM\Column(type="datetime")
*/
private $created;
/**
* @ORM\ManyToOne(targetEntity=AdUser::class)
* @ORM\JoinColumn(name="createdby", referencedColumnName="ad_user_id", nullable=false)
*/
private $ad_user;
/**
* @ORM\Column(type="integer")
*/
private $createdby;
/**
* @ORM\Column(type="datetime")
*/
private $updated;
/**
* @ORM\Column(type="integer")
*/
private $updatedby;
/**
* @ORM\OneToMany(targetEntity=MProductprice::class, mappedBy="m_product")
*/
private $m_productprices;
private $price;
/**
* @ORM\Column(type="integer")
*/
private $c_taxcategory_id;
/**
* @ORM\Column(type="integer")
*/
private $c_uom_id;
/**
* @ORM\Column(type="string", length=1)
*/
private $issummary;
/**
* @ORM\Column(type="string", length=2500, nullable=true)
*/
private $allegation;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $sm_characteristicset_id;
/**
* @ORM\ManyToOne(targetEntity=SmCharacteristicset::class)
* @ORM\JoinColumn(referencedColumnName="sm_characteristicset_id")
*/
private $sm_characteristicset;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $m_attributeset_id;
/**
* @ORM\ManyToOne(targetEntity=MAttributeset::class)
* @ORM\JoinColumn(referencedColumnName="m_attributeset_id")
*/
private $m_attributeset;
/**
* @ORM\Column(type="string", length=250, nullable=true)
*/
private $comercialname;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $m_attributesetinstance_id;
/**
* @ORM\OneToOne(targetEntity=MAttributesetinstance::class, cascade={"persist", "remove"})
* @ORM\JoinColumn(referencedColumnName="m_attributesetinstance_id")
*/
private $m_attributesetinstance;
/**
* @ORM\OneToMany(targetEntity=SmMPromotionprecondition::class, mappedBy="m_product")
*/
private $sm_m_promotionprecondition;
/**
* @ORM\OneToMany(targetEntity=SmUserProductaccess::class, mappedBy="m_product")
*/
private $sm_user_productaccesses;
/**
* @ORM\OneToMany(targetEntity=SmFichaTecnica::class, mappedBy="m_product")
*/
private $sm_fichas_tecnicas;
/**
* @ORM\OneToMany(targetEntity=SmPrecioEstimadoline::class, mappedBy="m_product")
*/
private $sm_precios_estimadolines;
/**
* @ORM\Column(type="string", length=1)
*/
private $iswebstorefeatured;
/**
* @ORM\OneToMany(targetEntity=StorageOnHand::class, mappedBy="product")
*/
private $storagesOnHand;
/**
* @ORM\OneToMany(targetEntity=Reservation::class, mappedBy="product")
*/
private $reservationList;
/**
* @ORM\Column(type="string", length=1, nullable=true)
*/
private $discontinued;
public function __construct()
{
$this->m_productdownload = new ArrayCollection();
$this->m_productprices = new ArrayCollection();
$this->sm_m_promotionprecondition = new ArrayCollection();
$this->sm_user_productaccesses = new ArrayCollection();
$this->sm_fichas_tecnicas = new ArrayCollection();
$this->sm_precios_estimadolines = new ArrayCollection();
$this->storagesOnHand = new ArrayCollection();
}
public function getId(): ?int
{
return $this->getMProductId();
}
public function getAdClientId(): ?int
{
return $this->ad_client_id;
}
public function setAdClientId(int $ad_client_id): self
{
$this->ad_client_id = $ad_client_id;
return $this;
}
public function getAdOrgId(): ?int
{
return $this->ad_org_id;
}
public function setAdOrgId(int $ad_org_id): self
{
$this->ad_org_id = $ad_org_id;
return $this;
}
public function getMProductId(): ?int
{
return $this->m_product_id;
}
public function setMProductId(int $m_product_id): self
{
$this->m_product_id = $m_product_id;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(string $description): self
{
$this->description = $description;
return $this;
}
public function getSku(): ?string
{
return $this->sku;
}
public function setSku(string $sku): self
{
$this->sku = $sku;
return $this;
}
public function getValue(): ?string
{
return $this->value;
}
public function setValue(string $value): self
{
$this->value = $value;
return $this;
}
public function getSmMarca(): ?SmMarca
{
return $this->sm_marca;
}
public function setSmMarca(?SmMarca $sm_marca): self
{
$this->sm_marca = $sm_marca;
return $this;
}
public function getSmMarcaId(): ?int
{
return $this->sm_marca_id;
}
public function setSmMarcaId(int $sm_marca_id): self
{
$this->sm_marca_id = $sm_marca_id;
return $this;
}
public function getMProductCategory(): ?MProductCategory
{
return $this->m_product_category;
}
public function setMProductCategory(?MProductCategory $m_product_category): self
{
$this->m_product_category = $m_product_category;
return $this;
}
public function getMProductCategoryId(): ?int
{
return $this->m_product_category_id;
}
public function setMProductCategoryId(int $m_product_category_id): self
{
$this->m_product_category_id = $m_product_category_id;
return $this;
}
public function isActive(): ?bool
{
return $this->getIsactive() === "Y";
}
public function getIsactive(): ?string
{
return $this->isactive;
}
public function setIsactive(string $isactive): self
{
$this->isactive = $isactive;
return $this;
}
public function getIssold(): ?string
{
return $this->issold;
}
public function setIssold(string $issold): self
{
$this->issold = $issold;
return $this;
}
/**
* @return Collection|MProductdownload[]
*/
public function getMProductdownload(): Collection
{
return $this->m_productdownload;
}
public function addMProductdownload(MProductdownload $mProductdownload): self
{
if (!$this->m_productdownload->contains($mProductdownload)) {
$this->m_productdownload[] = $mProductdownload;
$mProductdownload->setMProduct($this);
}
return $this;
}
public function removeMProductdownload(MProductdownload $mProductdownload): self
{
if ($this->m_productdownload->removeElement($mProductdownload)) {
// set the owning side to null (unless already changed)
if ($mProductdownload->getMProduct() === $this) {
$mProductdownload->setMProduct(null);
}
}
return $this;
}
public function getSmModeloProducto(): ?SmModeloProducto
{
return $this->sm_modelo_producto;
}
public function setSmModeloProducto(?SmModeloProducto $sm_modelo_producto): self
{
$this->sm_modelo_producto = $sm_modelo_producto;
return $this;
}
public function getSmModeloProductoId(): ?int
{
return $this->sm_modelo_producto_id;
}
public function setSmModeloProductoId(int $sm_modelo_producto_id): self
{
$this->sm_modelo_producto_id = $sm_modelo_producto_id;
return $this;
}
public function getCreated(): ?\DateTimeInterface
{
return $this->created;
}
public function setCreated(\DateTimeInterface $created): self
{
$this->created = $created;
return $this;
}
public function getAdUser(): ?AdUser
{
return $this->ad_user;
}
public function setAdUser(?AdUser $ad_user): self
{
$this->ad_user = $ad_user;
return $this;
}
public function getCreatedby(): ?int
{
return $this->createdby;
}
public function setCreatedby(int $createdby): self
{
$this->createdby = $createdby;
return $this;
}
public function getUpdated(): ?\DateTimeInterface
{
return $this->updated;
}
public function setUpdated(\DateTimeInterface $updated): self
{
$this->updated = $updated;
return $this;
}
public function getUpdatedby(): ?int
{
return $this->updatedby;
}
public function setUpdatedby(int $updatedby): self
{
$this->updatedby = $updatedby;
return $this;
}
/**
* @return Collection|MProductprice[]
*/
public function getMProductprices(): Collection
{
return $this->m_productprices;
}
public function addMProductprice(MProductprice $mProductprice): self
{
if (!$this->m_productprices->contains($mProductprice)) {
$this->m_productprices[] = $mProductprice;
$mProductprice->setMProduct($this);
}
return $this;
}
public function removeMProductprice(MProductprice $mProductprice): self
{
if ($this->m_productprices->removeElement($mProductprice)) {
// set the owning side to null (unless already changed)
if ($mProductprice->getMProduct() === $this) {
$mProductprice->setMProduct(null);
}
}
return $this;
}
public function getPrice (): float
{
return $this->price ?: 0;
}
public function setPrice(float $price): self
{
$this->price = $price;
return $this;
}
public function getCTaxcategoryId(): ?int
{
return $this->c_taxcategory_id;
}
public function setCTaxcategoryId(int $c_taxcategory_id): self
{
$this->c_taxcategory_id = $c_taxcategory_id;
return $this;
}
public function getCUomId(): ?int
{
return $this->c_uom_id;
}
public function setCUomId(int $c_uom_id): self
{
$this->c_uom_id = $c_uom_id;
return $this;
}
public function getIssummary(): ?string
{
return $this->issummary;
}
public function setIssummary(string $issummary): self
{
$this->issummary = $issummary;
return $this;
}
public function getAllegation(): ?string
{
return $this->allegation;
}
public function setAllegation(?string $allegation): self
{
$this->allegation = $allegation;
return $this;
}
public function getSmCharacteristicsetId(): ?int
{
return $this->sm_characteristicset_id;
}
public function setSmCharacteristicsetId(int $sm_characteristicset_id): self
{
$this->sm_characteristicset_id = $sm_characteristicset_id;
return $this;
}
public function getSmCharacteristicset(): ?SmCharacteristicset
{
return $this->sm_characteristicset;
}
public function setSmCharacteristicset(?SmCharacteristicset $sm_characteristicset): self
{
$this->sm_characteristicset = $sm_characteristicset;
return $this;
}
public function getMAttributesetId(): ?int
{
return $this->m_attributeset_id;
}
public function setMAttributesetId(?int $m_attributeset_id): self
{
$this->m_attributeset_id = $m_attributeset_id;
return $this;
}
public function getMAttributeset(): ?MAttributeset
{
return $this->m_attributeset;
}
public function setMAttributeset(?MAttributeset $m_attributeset): self
{
$this->m_attributeset = $m_attributeset;
return $this;
}
public function getComercialname(): ?string
{
return $this->comercialname;
}
public function setComercialname(?string $comercialname): self
{
$this->comercialname = $comercialname;
return $this;
}
public function getMAttributesetinstanceId(): ?int
{
return $this->m_attributesetinstance_id;
}
public function setMAttributesetinstanceId(?int $m_attributesetinstance_id): self
{
$this->m_attributesetinstance_id = $m_attributesetinstance_id;
return $this;
}
public function getMAttributesetinstance(): ?MAttributesetinstance
{
return $this->m_attributesetinstance;
}
public function setMAttributesetinstance(?MAttributesetinstance $m_attributesetinstance): self
{
$this->m_attributesetinstance = $m_attributesetinstance;
return $this;
}
/**
* @return Collection<int, SmMPromotionprecondition>
*/
public function getSmMPromotionpreconditions(): Collection
{
return $this->sm_m_promotionprecondition;
}
/**
* @return Collection<int, SmUserProductaccess>
*/
public function getSmUserProductaccess(): Collection
{
return $this->sm_user_productaccesses;
}
/**
* @return Collection<int, SmFichaTecnica>
*/
public function getSmFichasTecnicas(): Collection
{
return $this->sm_fichas_tecnicas;
}
public function addSmFichasTecnica(SmFichaTecnica $smFichasTecnica): self
{
if (!$this->sm_fichas_tecnicas->contains($smFichasTecnica)) {
$this->sm_fichas_tecnicas[] = $smFichasTecnica;
$smFichasTecnica->setMProduct($this);
}
return $this;
}
public function removeSmFichasTecnica(SmFichaTecnica $smFichasTecnica): self
{
if ($this->sm_fichas_tecnicas->removeElement($smFichasTecnica)) {
// set the owning side to null (unless already changed)
if ($smFichasTecnica->getMProduct() === $this) {
$smFichasTecnica->setMProduct(null);
}
}
return $this;
}
/**
* @return Collection<int, SmPrecioEstimadoline>
*/
public function getSmPreciosEstimadolines(): Collection
{
return $this->sm_precios_estimadolines;
}
public function getIswebstorefeatured(): ?string
{
return $this->iswebstorefeatured;
}
public function setIswebstorefeatured(string $iswebstorefeatured): self
{
$this->iswebstorefeatured = $iswebstorefeatured;
return $this;
}
/**
* @return Collection|StorageOnHand[]
*/
public function getStoragesOnHand(): Collection
{
return $this->storagesOnHand;
}
/**
* @return Collection|Reservation[]
*/
public function getReservationList(): Collection
{
return $this->reservationList;
}
}