<?php
namespace Plugin\Recipe\Entity;
use Doctrine\ORM\Mapping as ORM;
if (!class_exists('\Plugin\Recipe\Entity\Tag', false)) {
/**
* Tag
*
* @ORM\Table(name="plg_recipe_tag")
* @ORM\DiscriminatorColumn(name="discriminator_type", type="string", length=255)
* @ORM\Entity(repositoryClass="Plugin\Recipe\Repository\TagRepository")
*/
class Tag
{
/**
* @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\RecipeTag", mappedBy="Tag")
*/
protected $RecipeTag;
/**
* Constructor
*/
public function __construct()
{
$this->RecipeTag = 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 recipeTag.
*
* @param \Plugin\Recipe\Entity\RecipeTag $recipeTag
*
* @return Tag
*/
public function addRecipeTag(RecipeTag $recipeTag)
{
$this->RecipeTag[] = $recipeTag;
return $this;
}
/**
* Remove recipeTag.
*
* @param \Plugin\Recipe\Entity\RecipeTag $recipeTag
*
* @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
*/
public function removeRecipeTag(RecipeTag $recipeTag)
{
return $this->RecipeTag->removeElement($recipeTag);
}
/**
* Get recipeTag.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getRecipeTag()
{
return $this->RecipeTag;
}
}
}