<?php
/**
* Product class represents model of Product entity
*
* $Project: Alliancemarkets2 $
* $Id$
*
* @package alliancemarkets2
* @author George Matyas <webexciter@yahoo.com>
* @version $Revision$
*/
// src/AppBundle/Entity/Product.php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Gedmo\Translatable\Translatable;
/**
* @ORM\Entity(repositoryClass="App\EntityRepo\ProductRepo")
* @ORM\Table(name="product")
* @Gedmo\TranslationEntity(class="App\Entity\ProductTranslation")
*/
class Product implements Translatable
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $productId=0;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
protected $productKey;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
protected $EAN;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
protected $ERPKey;
/**
* Many Products have Many Prices.
* @ORM\ManyToMany(targetEntity="Price")
* @ORM\JoinTable(name="product_price",
* joinColumns={@ORM\JoinColumn(name="product_id", referencedColumnName="product_id")},
* inverseJoinColumns={@ORM\JoinColumn(name="price_id", referencedColumnName="price_id", unique=false)}
* )
*/
protected $prices;
/**
* @ORM\Column(type="integer")
*/
protected $parentProductId=0;
/**
* @Gedmo\Translatable
* @ORM\Column(type="string", length=100, nullable=true)
*/
protected $productName;
/**
* @Gedmo\Translatable
* @ORM\Column(type="text", nullable=true)
*/
protected $productDescription;
/**
* @Gedmo\Translatable
* @ORM\Column(type="string", nullable=true)
*/
protected $productShortDescription;
/**
* Post locale
* Used locale to override Translation listener's locale
*
* @Gedmo\Locale
*
*/
protected $locale;
/**
* Assert\Image( maxSize = "3072k", mimeTypesMessage = "Please upload a valid Image")
*
* @ORM\Column(type="string", length=255, nullable=true)
*/
protected $image1;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
protected $image2;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
protected $image3;
/**
* One Product has Many Galleries.
* @ORM\ManyToMany(targetEntity="Gallery")
* @ORM\JoinTable(name="product_gallery",
* joinColumns={@ORM\JoinColumn(name="product_id", referencedColumnName="product_id")},
* inverseJoinColumns={@ORM\JoinColumn(name="gallery_id", referencedColumnName="gallery_id", unique=false)}
* )
*/
protected $imageGallery;
/*
* @ORM\ManyToMany(targetEntity="Category", cascade={"remove"}, orphanRemoval=true)
*/
/**
* One Product has Many Categories.
* @ORM\ManyToMany(targetEntity="Category")
* @ORM\JoinTable(name="product_category",
* joinColumns={@ORM\JoinColumn(name="product_id", referencedColumnName="product_id")},
* inverseJoinColumns={@ORM\JoinColumn(name="category_id", referencedColumnName="category_id", unique=false)}
* )
*/
protected $categories;
/**
* One Product has Many Product Groups.
* @ORM\ManyToMany(targetEntity="ProductGroup")
* @ORM\JoinTable(name="product_groups",
* joinColumns={@ORM\JoinColumn(name="product_id", referencedColumnName="product_id")},
* inverseJoinColumns={@ORM\JoinColumn(name="product_group_id", referencedColumnName="product_group_id", unique=false)}
* )
*/
protected $productGroups;
/**
* @ORM\Column(type="boolean", options={"default":"1"})
*/
protected $isActive;
/**
* @ORM\Column(type="datetime", nullable=true, nullable=true)
*/
protected $activeFrom;
/**
* @ORM\Column(type="datetime", nullable=true, nullable=true)
*/
protected $activeTo;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
protected $unitName;
/**
* @ORM\Column(type="integer", nullable=true)
*/
protected $marketplaceDepartmentId=0;
/**
* One Product has Many Departments.
* @ORM\ManyToMany(targetEntity="Department")
* @ORM\JoinTable(name="product_department",
* joinColumns={@ORM\JoinColumn(name="product_id", referencedColumnName="product_id")},
* inverseJoinColumns={@ORM\JoinColumn(name="department_id", referencedColumnName="department_id", unique=false)}
* )
*/
protected $departments;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
protected $productLink;
/**
* @ORM\Column(type="integer")
*/
protected $viewedCount=0;
/**
* @ORM\Column(type="integer")
*/
protected $clickedCount=0;
/**
* @ORM\Column(type="integer", nullable=true)
*/
protected $productVAT;
/**
* @ORM\Column(type="integer", nullable=true)
*/
protected $stock;
/**
* @Gedmo\Translatable
* @ORM\Column(type="string", length=255, nullable=true)
*/
protected $titleSEO;
/**
* @Gedmo\Translatable
* @ORM\Column(type="string", length=255, nullable=true)
*/
protected $keywordsSEO;
/**
* @ORM\Column(type="integer", nullable=true)
*/
protected $priority=3;
/**
* @ORM\Column(type="integer", nullable=true)
*/
protected $piecesInPack;
/**
* @ORM\Column(type="float", nullable=true)
*/
protected $packPrice;
/**
* @ORM\Column(type="boolean", options={"default":false}, nullable=true)
*/
protected $isStrictPackSale;
/**
* Many Products have Many PackagePrices.
* @ORM\ManyToMany(targetEntity="Price")
* @ORM\JoinTable(name="product_package_price",
* joinColumns={@ORM\JoinColumn(name="product_id", referencedColumnName="product_id")},
* inverseJoinColumns={@ORM\JoinColumn(name="price_id", referencedColumnName="price_id", unique=false)}
* )
*/
protected $packagePrices;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
protected $productModelLink;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
protected $manufacturer;
/**
* @ORM\Column(type="integer", nullable=true)
*/
protected $gallery3dId=0;
/**
* @ORM\Column(type="integer", nullable=true)
*/
protected $minimalAmount=0;
/**
* Constructor
*/
public function __construct()
{
$this->prices = new \Doctrine\Common\Collections\ArrayCollection();
$this->imageGallery = new ArrayCollection();
$this->categories = new ArrayCollection();
$this->productGroups = new ArrayCollection();
$this->departments = new ArrayCollection();
$this->packagePrices = new ArrayCollection();
}
/**
* Get productId
*
* @return integer
*/
public function getProductId()
{
return $this->productId;
}
/**
* Set productKey
*
* @param string $productKey
*
* @return Product
*/
public function setProductKey($productKey)
{
$this->productKey = $productKey;
return $this;
}
/**
* Get productKey
*
* @return string
*/
public function getProductKey()
{
return $this->productKey;
}
/**
* Set eAN
*
* @param string $eAN
*
* @return Product
*/
public function setEAN($eAN)
{
$this->EAN = $eAN;
return $this;
}
/**
* Get eAN
*
* @return string
*/
public function getEAN()
{
return $this->EAN;
}
/**
* Set eRPKey
*
* @param string $eRPKey
*
* @return Product
*/
public function setERPKey($eRPKey)
{
$this->ERPKey = $eRPKey;
return $this;
}
/**
* Get eRPKey
*
* @return string
*/
public function getERPKey()
{
return $this->ERPKey;
}
/**
* Set parentProductId
*
* @param integer $parentProductId
*
* @return Product
*/
public function setParentProductId($parentProductId)
{
$this->parentProductId = $parentProductId;
return $this;
}
/**
* Get parentProductId
*
* @return integer
*/
public function getParentProductId()
{
return $this->parentProductId;
}
/**
* Set productName
*
* @param string $productName
*
* @return Product
*/
public function setProductName($productName)
{
$this->productName = $productName;
return $this;
}
/**
* Get productName
*
* @return string
*/
public function getProductName()
{
return $this->productName;
}
/**
* Set productDescription
*
* @param string $productDescription
*
* @return Product
*/
public function setProductDescription($productDescription)
{
$this->productDescription = $productDescription;
return $this;
}
/**
* Get productDescription
*
* @return string
*/
public function getProductDescription()
{
return $this->productDescription;
}
/**
* Set productShortDescription
*
* @param string $productShortDescription
*
* @return Product
*/
public function setProductShortDescription($productShortDescription)
{
$this->productShortDescription = $productShortDescription;
return $this;
}
/**
* Get productShortDescription
*
* @return string
*/
public function getProductShortDescription()
{
return $this->productShortDescription;
}
/**
* Set image1
*
* @param string $image1
*
* @return Product
*/
public function setImage1($image1)
{
$this->image1 = $image1;
return $this;
}
/**
* Get image1
*
* @return string
*/
public function getImage1()
{
return $this->image1;
}
/**
* Set image2
*
* @param string $image2
*
* @return Product
*/
public function setImage2($image2)
{
$this->image2 = $image2;
return $this;
}
/**
* Get image2
*
* @return string
*/
public function getImage2()
{
return $this->image2;
}
/**
* Set image3
*
* @param string $image3
*
* @return Product
*/
public function setImage3($image3)
{
$this->image3 = $image3;
return $this;
}
/**
* Get image3
*
* @return string
*/
public function getImage3()
{
return $this->image3;
}
/**
* Set isActive
*
* @param boolean $isActive
*
* @return Product
*/
public function setIsActive($isActive)
{
$this->isActive = $isActive;
return $this;
}
/**
* Get isActive
*
* @return boolean
*/
public function getIsActive()
{
return $this->isActive;
}
/**
* Set activeFrom
*
* @param \DateTime $activeFrom
*
* @return Product
*/
public function setActiveFrom($activeFrom)
{
$this->activeFrom = $activeFrom;
return $this;
}
/**
* Get activeFrom
*
* @return \DateTime
*/
public function getActiveFrom()
{
return $this->activeFrom;
}
/**
* Set activeTo
*
* @param \DateTime $activeTo
*
* @return Product
*/
public function setActiveTo($activeTo)
{
$this->activeTo = $activeTo;
return $this;
}
/**
* Get activeTo
*
* @return \DateTime
*/
public function getActiveTo()
{
return $this->activeTo;
}
/**
* Set unitName
*
* @param string $unitName
*
* @return Product
*/
public function setUnitName($unitName)
{
$this->unitName = $unitName;
return $this;
}
/**
* Get unitName
*
* @return string
*/
public function getUnitName()
{
return $this->unitName;
}
/**
* Set marketplaceDepartmentId
*
* @param integer $marketplaceDepartmentId
*
* @return Product
*/
public function setMarketplaceDepartmentId($marketplaceDepartmentId)
{
$this->marketplaceDepartmentId = $marketplaceDepartmentId;
return $this;
}
/**
* Get marketplaceDepartmentId
*
* @return integer
*/
public function getMarketplaceDepartmentId()
{
return $this->marketplaceDepartmentId;
}
/**
* Add price
*
* @param \App\Entity\Price $price
*
* @return Product
*/
public function addPrice(\App\Entity\Price $price)
{
$this->prices[] = $price;
return $this;
}
/**
* Remove price
*
* @param \App\Entity\Price $price
*/
public function removePrice(\App\Entity\Price $price)
{
$this->prices->removeElement($price);
}
/**
* Get prices
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getPrices()
{
return $this->prices;
}
/**
* Add imageGallery
*
* @param \App\Entity\Gallery $imageGallery
*
* @return Product
*/
public function addImageGallery(\App\Entity\Gallery $imageGallery)
{
$this->imageGallery[] = $imageGallery;
return $this;
}
/**
* Remove imageGallery
*
* @param \App\Entity\Gallery $imageGallery
*/
public function removeImageGallery(\App\Entity\Gallery $imageGallery)
{
$this->imageGallery->removeElement($imageGallery);
}
/**
* Get imageGallery
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getImageGallery()
{
return $this->imageGallery;
}
/**
* Add category
*
* @param \App\Entity\Category $category
*
* @return Product
*/
public function addCategory(\App\Entity\Category $category)
{
$this->categories[] = $category;
return $this;
}
/**
* Remove category
*
* @param \App\Entity\Category $category
*/
public function removeCategory(\App\Entity\Category $category)
{
$this->categories->removeElement($category);
}
/**
* Get categories
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getCategories()
{
return $this->categories;
}
/**
* Add productGroup
*
* @param \App\Entity\ProductGroup $productGroup
*
* @return Product
*/
public function addProductGroup(\App\Entity\ProductGroup $productGroup)
{
$this->productGroups[] = $productGroup;
return $this;
}
/**
* Remove productGroup
*
* @param \App\Entity\ProductGroup $productGroup
*/
public function removeProductGroup(\App\Entity\ProductGroup $productGroup)
{
$this->productGroups->removeElement($productGroup);
}
/**
* Get productGroups
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getProductGroups()
{
return $this->productGroups;
}
/**
* Set locale
*
* @param string $locale
*
* @return Product
*/
public function setLocale($locale)
{
$this->locale = $locale;
return $this;
}
/**
* Get locale
*
* @return string
*/
public function getLocale()
{
return $this->locale;
}
/**
* Add department
*
* @param \App\Entity\Department $department
*
* @return Product
*/
public function addDepartment(\App\Entity\Department $department)
{
$this->departments[] = $department;
return $this;
}
/**
* Remove department
*
* @param \App\Entity\Department $department
*/
public function removeDepartment(\App\Entity\Department $department)
{
$this->departments->removeElement($department);
}
/**
* Get departments
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getDepartments()
{
return $this->departments;
}
/**
* Set productLink
*
* @param string $productLink
*
* @return Product
*/
public function setProductLink($productLink)
{
$this->productLink = $productLink;
return $this;
}
/**
* Get productLink
*
* @return string
*/
public function getProductLink()
{
return $this->productLink;
}
/**
* Set viewedCount
*
* @param integer $viewedCount
*
* @return Product
*/
public function setViewedCount($viewedCount)
{
$this->viewedCount = $viewedCount;
return $this;
}
/**
* Get viewedCount
*
* @return integer
*/
public function getViewedCount()
{
return $this->viewedCount;
}
/**
* Set clickedCount
*
* @param integer $clickedCount
*
* @return Product
*/
public function setClickedCount($clickedCount)
{
$this->clickedCount = $clickedCount;
return $this;
}
/**
* Get clickedCount
*
* @return integer
*/
public function getClickedCount()
{
return $this->clickedCount;
}
/**
* Set productVAT
*
* @param integer $productVAT
*
* @return Product
*/
public function setProductVAT($productVAT)
{
$this->productVAT = $productVAT;
return $this;
}
/**
* Get productVAT
*
* @return integer
*/
public function getProductVAT()
{
return $this->productVAT;
}
/**
* Set stock
*
* @param integer $stock
*
* @return Product
*/
public function setStock($stock)
{
$this->stock = $stock;
return $this;
}
/**
* Get stock
*
* @return integer
*/
public function getStock()
{
return $this->stock;
}
/**
* Set titleSEO
*
* @param string $titleSEO
*
* @return Product
*/
public function setTitleSEO($titleSEO)
{
$this->titleSEO = $titleSEO;
return $this;
}
/**
* Get titleSEO
*
* @return string
*/
public function getTitleSEO()
{
return $this->titleSEO;
}
/**
* Set keywordsSEO
*
* @param string $keywordsSEO
*
* @return Product
*/
public function setKeywordsSEO($keywordsSEO)
{
$this->keywordsSEO = $keywordsSEO;
return $this;
}
/**
* Get keywordsSEO
*
* @return string
*/
public function getKeywordsSEO()
{
return $this->keywordsSEO;
}
/**
* Set priority
*
* @param integer $priority
*
* @return Product
*/
public function setPriority($priority)
{
$this->priority = $priority;
return $this;
}
/**
* Get priority
*
* @return integer
*/
public function getPriority()
{
return $this->priority;
}
/**
* Set piecesInPack
*
* @param integer $piecesInPack
*
* @return Product
*/
public function setPiecesInPack($piecesInPack)
{
$this->piecesInPack = $piecesInPack;
return $this;
}
/**
* Get piecesInPack
*
* @return integer
*/
public function getPiecesInPack()
{
return $this->piecesInPack;
}
/**
* Set packPrice
*
* @param float $packPrice
*
* @return Product
*/
public function setPackPrice($packPrice)
{
$this->packPrice = $packPrice;
return $this;
}
/**
* Get packPrice
*
* @return float
*/
public function getPackPrice()
{
return $this->packPrice;
}
/**
* Set isStrictPackSale
*
* @param boolean $isStrictPackSale
*
* @return Product
*/
public function setIsStrictPackSale($isStrictPackSale)
{
$this->isStrictPackSale = $isStrictPackSale;
return $this;
}
/**
* Get isStrictPackSale
*
* @return boolean
*/
public function getIsStrictPackSale()
{
return $this->isStrictPackSale;
}
/**
* Add packagePrice
*
* @param \App\Entity\Price $packagePrice
*
* @return Product
*/
public function addPackagePrice(\App\Entity\Price $packagePrice)
{
$this->packagePrices[] = $packagePrice;
return $this;
}
/**
* Remove packagePrice
*
* @param \App\Entity\Price $packagePrice
*/
public function removePackagePrice(\App\Entity\Price $packagePrice)
{
$this->packagePrices->removeElement($packagePrice);
}
/**
* Get packagePrices
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getPackagePrices()
{
return $this->packagePrices;
}
/**
* Set productModelLink
*
* @param string $productModelLink
*
* @return Product
*/
public function setProductModelLink($productModelLink)
{
$this->productModelLink = $productModelLink;
return $this;
}
/**
* Get productModelLink
*
* @return string
*/
public function getProductModelLink()
{
return $this->productModelLink;
}
/**
* Set manufacturer
*
* @param string $manufacturer
*
* @return Product
*/
public function setManufacturer($manufacturer)
{
$this->manufacturer = $manufacturer;
return $this;
}
/**
* Get manufacturer
*
* @return string
*/
public function getManufacturer()
{
return $this->manufacturer;
}
/**
* Set gallery3dId
*
* @param integer $gallery3dId
*
* @return Product
*/
public function setGallery3dId($gallery3dId)
{
$this->gallery3dId = $gallery3dId;
return $this;
}
/**
* Get gallery3dId
*
* @return integer
*/
public function getGallery3dId()
{
return $this->gallery3dId;
}
/**
* Set minimalAmount
*
* @param integer $minimalAmount
*
* @return Product
*/
public function setMinimalAmount($minimalAmount)
{
$this->minimalAmount = $minimalAmount;
return $this;
}
/**
* Get minimalAmount
*
* @return integer
*/
public function getMinimalAmount()
{
return $this->minimalAmount;
}
public function isIsActive(): ?bool
{
return $this->isActive;
}
public function isIsStrictPackSale(): ?bool
{
return $this->isStrictPackSale;
}
}