<?php
/**
* Product class represents model of Category entity
*
* $Project: Alliancemarkets2 $
* $Id$
*
* @package alliancemarkets2
* @author George Matyas <webexciter@yahoo.com>
* @version $Revision$
*/
// src/AppBundle/Entity/Category.php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
/*
use Gedmo\Mapping\Annotation\Tree;
*/
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Gedmo\Translatable\Translatable;
use App\Entity\Eshop;
/*
@Gedmo\Mapping\Annotation\Tree(type="nested")
@Doctrine\ORM\Mapping\Entity(repositoryClass="Gedmo\Tree\Entity\Repository\NestedTreeRepository")
ORM\Entity(repositoryClass="App\EntityRepo\CategoryRepo")
*/
/**
*
*
*
* @ORM\Entity(repositoryClass="Gedmo\Tree\Entity\Repository\NestedTreeRepository")
* @ORM\Table(name="category")
* @Gedmo\TranslationEntity(class="App\Entity\CategoryTranslation")
* @Gedmo\Tree(type="nested")
*
* Doctrine\ORM\Mapping\Entity(repositoryClass="Gedmo\Tree\Entity\Repository\NestedTreeRepository")
*
*/
class Category implements Translatable
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $categoryId=0;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
protected $categoryKey;
/**
* @Gedmo\Translatable
* @ORM\Column(type="string", length=100, nullable=true)
*/
protected $categoryName;
/**
* @Gedmo\Translatable
* @ORM\Column(type="text", nullable=true)
*/
protected $categoryDescription;
/**
* 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;
/*
* 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)}
* )
*/
/*
* Doctrine\ORM\Mapping\ManyToOne(targetEntity="Category")
* Doctrine\ORM\Mapping\JoinColumn(name="parent_id", referencedColumnName="id", onDelete="CASCADE")
*
* @Gedmo\TreeParent
* @Doctrine\ORM\Mapping\ManyToOne(targetEntity="Category")
* @Doctrine\ORM\Mapping\JoinColumn(name="parent", referencedColumnName="parent", onDelete="CASCADE")
*
* @Gedmo\TreeParent
* @ORM\ManyToMany(targetEntity="Category")
* @ORM\JoinTable(name="category_category",
* joinColumns={@ORM\JoinColumn(name="category_id", referencedColumnName="category_id")},
* inverseJoinColumns={@ORM\JoinColumn(name="parent_id", referencedColumnName="parent_id", unique=false)}
* )
*/
/*
* @Gedmo\TreeParent
* @ORM\ManyToOne(targetEntity="Category", inversedBy="children")
* @ORM\JoinColumn(name="parent_id", referencedColumnName="category_id", onDelete="SET NULL")
*
*/
/**
* @Gedmo\TreeRoot
* @ORM\ManyToOne(targetEntity="Category")
* @ORM\JoinColumn(referencedColumnName="category_id", onDelete="CASCADE")
*/
protected $root;
/**
* @Gedmo\TreeParent
* @ORM\ManyToOne(targetEntity="Category", inversedBy="children")
* @ORM\JoinColumn(name="parent_id", referencedColumnName="category_id", onDelete="SET NULL")
*/
protected $parent;
/*
* @ORM\OneToMany(targetEntity="Category", mappedBy="parent")
*/
/**
* @ORM\OneToMany(targetEntity="Category", mappedBy="parent")
* @ORM\OrderBy({"lft" = "ASC"})
*/
protected $children;
/**
* @Gedmo\TreeLeft
* @Doctrine\ORM\Mapping\Column(type="integer", nullable=true)
*/
protected $lft;
/**
* @Gedmo\TreeLevel
* @ORM\Column(name="lvl", type="integer")
*/
protected $lvl;
/**
* @Gedmo\TreeRight
* @Doctrine\ORM\Mapping\Column(type="integer", nullable=true)
*/
protected $rgt;
/**
* @ORM\Column(type="integer")
*/
protected $eshopId;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
protected $ERPKey;
/**
* @ORM\Column(type="boolean", options={"default":"1"})
*/
protected $isActive;
/**
* @ORM\Column(type="boolean", options={"default":"0"}, nullable=true)
*/
protected $isHidden;
/**
* @ORM\Column(type="integer", nullable=true)
*/
protected $imageThumbWidth=100;
/**
* @ORM\Column(type="integer", nullable=true)
*/
protected $imageThumbHeight=100;
/**
* @ORM\Column(type="integer", nullable=true)
*/
protected $auctionHallId;
/**
* @ORM\Column(type="integer", nullable=true)
*/
protected $marketplaceDepartmentId=0;
/**
* @ORM\Column(type="integer", options={"default":"3"}, nullable=true)
*/
protected $priority=3;
/**
* Get categoryId
*
* @return integer
*/
public function getCategoryId()
{
return $this->categoryId;
}
/**
* Set categoryKey
*
* @param string $categoryKey
*
* @return Category
*/
public function setCategoryKey($categoryKey)
{
$this->categoryKey = $categoryKey;
return $this;
}
/**
* Get categoryKey
*
* @return string
*/
public function getCategoryKey()
{
return $this->categoryKey;
}
/**
* Set categoryName
*
* @param string $categoryName
*
* @return Category
*/
public function setCategoryName($categoryName)
{
$this->categoryName = $categoryName;
return $this;
}
/**
* Get categoryName
*
* @return string
*/
public function getCategoryName()
{
return $this->categoryName;
}
/**
* Set image1
*
* @param string $image1
*
* @return Category
*/
public function setImage1($image1)
{
$this->image1 = $image1;
return $this;
}
/**
* Get image1
*
* @return string
*/
public function getImage1()
{
return $this->image1;
}
/**
* 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;
}
/**
* Constructor
*/
public function __construct()
{
$this->parent = new \Doctrine\Common\Collections\ArrayCollection();
$this->children = new ArrayCollection();
}
/**
* Set lft
*
* @param integer $lft
*
* @return Category
*/
public function setLft($lft)
{
$this->lft = $lft;
return $this;
}
/**
* Get lft
*
* @return integer
*/
public function getLft()
{
return $this->lft;
}
/**
* Set rgt
*
* @param integer $rgt
*
* @return Category
*/
public function setRgt($rgt)
{
$this->rgt = $rgt;
return $this;
}
/**
* Get rgt
*
* @return integer
*/
public function getRgt()
{
return $this->rgt;
}
/**
* Add parent
*
* @param \App\Entity\Category $parent
*
* @return Category
*/
public function addParent(\App\Entity\Category $parent)
{
$this->parent[] = $parent;
return $this;
}
/**
* Remove parent
*
* @param \App\Entity\Category $parent
*/
public function removeParent(\App\Entity\Category $parent)
{
$this->parent->removeElement($parent);
}
/**
* Get parent
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getParent()
{
return $this->parent;
}
/**
* Set parent
*
* @param \App\Entity\Category $parent
*
* @return Category
*/
public function setParent(\App\Entity\Category $parent = null)
{
$this->parent = $parent;
return $this;
}
/**
* Add child
*
* @param \App\Entity\Category $child
*
* @return Category
*/
public function addChild(\App\Entity\Category $child)
{
$this->children[] = $child;
return $this;
}
/**
* Remove child
*
* @param \App\Entity\Category $child
*/
public function removeChild(\App\Entity\Category $child)
{
$this->children->removeElement($child);
}
/**
* Get children
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getChildren()
{
return $this->children;
}
/**
* Set lvl
*
* @param integer $lvl
*
* @return Category
*/
public function setLvl($lvl)
{
$this->lvl = $lvl;
return $this;
}
/**
* Get lvl
*
* @return integer
*/
public function getLvl()
{
return $this->lvl;
}
/**
* Set root
*
* @param \App\Entity\Category $root
*
* @return Category
*/
public function setRoot(\App\Entity\Category $root = null)
{
$this->root = $root;
return $this;
}
/**
* Get root
*
* @return \App\Entity\Category
*/
public function getRoot()
{
return $this->root;
}
/**
* Set eshop
*
* @param \App\Entity\Eshop $eshop
*
* @return Category
*/
public function setEshop(\App\Entity\Eshop $eshop = null)
{
$this->eshop = $eshop;
return $this;
}
/**
* Get eshop
*
* @return \App\Entity\Eshop
*/
public function getEshop()
{
return $this->eshop;
}
/**
* Add eshop
*
* @param \App\Entity\Eshop $eshop
*
* @return Category
*/
public function addEshop(\App\Entity\Eshop $eshop)
{
$this->eshop[] = $eshop;
return $this;
}
/**
* Remove eshop
*
* @param \App\Entity\Eshop $eshop
*/
public function removeEshop(\App\Entity\Eshop $eshop)
{
$this->eshop->removeElement($eshop);
}
/**
* Add eshop2
*
* @param \App\Entity\Eshop $eshop2
*
* @return Category
*/
public function addEshop2(\App\Entity\Eshop $eshop2)
{
$this->eshop2[] = $eshop2;
return $this;
}
/**
* Remove eshop2
*
* @param \App\Entity\Eshop $eshop2
*/
public function removeEshop2(\App\Entity\Eshop $eshop2)
{
$this->eshop2->removeElement($eshop2);
}
/**
* Get eshop2
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getEshop2()
{
return $this->eshop2;
}
/**
* Set eshopId
*
* @param integer $eshopId
*
* @return Category
*/
public function setEshopId($eshopId)
{
$this->eshopId = $eshopId;
return $this;
}
/**
* Get eshopId
*
* @return integer
*/
public function getEshopId()
{
return $this->eshopId;
}
/**
* Set categoryDescription
*
* @param string $categoryDescription
*
* @return Category
*/
public function setCategoryDescription($categoryDescription)
{
$this->categoryDescription = $categoryDescription;
return $this;
}
/**
* Get categoryDescription
*
* @return string
*/
public function getCategoryDescription()
{
return $this->categoryDescription;
}
/**
* Set eRPKey
*
* @param string $eRPKey
*
* @return Category
*/
public function setERPKey($eRPKey)
{
$this->ERPKey = $eRPKey;
return $this;
}
/**
* Get eRPKey
*
* @return string
*/
public function getERPKey()
{
return $this->ERPKey;
}
/**
* Set isActive
*
* @param boolean $isActive
*
* @return Category
*/
public function setIsActive($isActive)
{
$this->isActive = $isActive;
return $this;
}
/**
* Get isActive
*
* @return boolean
*/
public function getIsActive()
{
return $this->isActive;
}
/**
* Set isHidden
*
* @param boolean $isHidden
*
* @return Category
*/
public function setIsHidden($isHidden)
{
$this->isHidden = $isHidden;
return $this;
}
/**
* Get isHidden
*
* @return boolean
*/
public function getIsHidden()
{
return $this->isHidden;
}
/**
* Set imageThumbWidth
*
* @param integer $imageThumbWidth
*
* @return Category
*/
public function setImageThumbWidth($imageThumbWidth)
{
$this->imageThumbWidth = $imageThumbWidth;
return $this;
}
/**
* Get imageThumbWidth
*
* @return integer
*/
public function getImageThumbWidth()
{
return $this->imageThumbWidth;
}
/**
* Set imageThumbHeight
*
* @param integer $imageThumbHeight
*
* @return Category
*/
public function setImageThumbHeight($imageThumbHeight)
{
$this->imageThumbHeight = $imageThumbHeight;
return $this;
}
/**
* Get imageThumbHeight
*
* @return integer
*/
public function getImageThumbHeight()
{
return $this->imageThumbHeight;
}
/**
* Set auctionHallId
*
* @param integer $auctionHallId
*
* @return Category
*/
public function setAuctionHallId($auctionHallId)
{
$this->auctionHallId = $auctionHallId;
return $this;
}
/**
* Get auctionHallId
*
* @return integer
*/
public function getAuctionHallId()
{
return $this->auctionHallId;
}
/**
* Set marketplaceDepartmentId
*
* @param integer $marketplaceDepartmentId
*
* @return Category
*/
public function setMarketplaceDepartmentId($marketplaceDepartmentId)
{
$this->marketplaceDepartmentId = $marketplaceDepartmentId;
return $this;
}
/**
* Get marketplaceDepartmentId
*
* @return integer
*/
public function getMarketplaceDepartmentId()
{
return $this->marketplaceDepartmentId;
}
public function isIsActive(): ?bool
{
return $this->isActive;
}
public function isIsHidden(): ?bool
{
return $this->isHidden;
}
public function getPriority(): ?int
{
return $this->priority;
}
public function setPriority(?int $priority): static
{
$this->priority = $priority;
return $this;
}
}