<?php
namespace Plugin\Recipe\Entity;
use Doctrine\ORM\Mapping as ORM;
if (!class_exists('\Plugin\Recipe\Entity\Category', false)) {
/**
* Category
*
* @ORM\Table(name="plg_recipe_category")
* @ORM\DiscriminatorColumn(name="discriminator_type", type="string", length=255)
* @ORM\Entity(repositoryClass="Plugin\Recipe\Repository\CategoryRepository")
*/
class Category
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer", options={"unsigned":true})
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="name", type="string", length=255)
*/
private $name;
/**
* @var int
*
* @ORM\Column(name="sort_no", type="integer", nullable=true)
*/
private $sort_no;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\OneToMany(targetEntity="Plugin\Recipe\Entity\RecipeCategory", mappedBy="Category")
*/
protected $RecipeCategory;
/**
* Constructor
*/
public function __construct()
{
$this->RecipeCategory = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* @param string $name
*
* @return $this;
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get rank.
*
* @return int
*/
public function getSortno()
{
return $this->sort_no;
}
/**
* Set rank.
*
* @param int $sort_no
*
* @return $this
*/
public function setSortno($sort_no)
{
$this->sort_no = $sort_no;
return $this;
}
/**
* Add recipeCategory.
*
* @param \Plugin\Recipe\Entity\RecipeCategory $recipeCategory
*
* @return Category
*/
public function addRecipeCategory(RecipeCategory $recipeCategory)
{
$this->RecipeCategory[] = $recipeCategory;
return $this;
}
/**
* Remove recipeCategory.
*
* @param \Plugin\Recipe\Entity\RecipeCategory $recipeCategory
*
* @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
*/
public function removeRecipeCategory(RecipeCategory $recipeCategory)
{
return $this->RecipeCategory->removeElement($recipeCategory);
}
/**
* Get recipeCategory.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getRecipeCategory()
{
return $this->RecipeCategory;
}
}
}