<?php

namespace OfficeBrain\Bundle\BlogBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Validator\Constraints as Assert;
use Doctrine\Common\Collections\ArrayCollection;




/**
 * Tag
 *
 * @ORM\Table("tbl_blog_tag")
 * @ORM\Entity(repositoryClass="OfficeBrain\Bundle\BlogBundle\Entity\TagRepository")
 */
class Tag
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="tag_name", type="string", length=255)
     * @Assert\NotBlank(message="This field is required.")
     */
    private $tagName;

    /**
     * @var string
     * @Gedmo\Slug(fields={"tagName","id"})
     * @ORM\Column(length=128, unique=true,nullable=true)
     */
    private $slug;
    

    /**
     * @var boolean
     *
     * @ORM\Column(name="tag_status", type="boolean", options={"default" = "1"})
     */
    private $tagStatus;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="tag_created_date", type="datetime")
     * @Gedmo\Timestampable(on="create")
     */
    private $tagCreatedDate;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="tag_updated_date", type="datetime")
     * @Gedmo\Timestampable(on="update")
     */
    private $tagUpdatedDate;
    
    /**
     * @var boolean
     *
     * @ORM\Column(name="tag_is_deleted", type="boolean", options={"default" = "0"})
     */
    private $tagIsDeleted;
    
    /**
     * @ORM\OneToMany(targetEntity="PostTagInfo", mappedBy="tagId")
     */
    protected $postTagInfo;
    
    /**
     * Constructor
     */
    public function __construct()
    {
        $this->postTagInfo = new \Doctrine\Common\Collections\ArrayCollection();
    }

    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set tagName
     *
     * @param string $tagName
     * @return Tag
     */
    public function setTagName($tagName)
    {
        $this->tagName = $tagName;

        return $this;
    }

    /**
     * Get tagName
     *
     * @return string 
     */
    public function getTagName()
    {
        return $this->tagName;
    }

    /**
     * Set tagTitle
     *
     * @param string $tagTitle
     * @return Tag
     */
    public function setTagTitle($tagTitle)
    {
        $this->tagTitle = $tagTitle;

        return $this;
    }

    /**
     * Get tagTitle
     *
     * @return string 
     */
    public function getTagTitle()
    {
        return $this->tagTitle;
    }

    /**
     * Set tagStatus
     *
     * @param boolean $tagStatus
     * @return Tag
     */
    public function setTagStatus($tagStatus)
    {
        $this->tagStatus = $tagStatus;

        return $this;
    }

    /**
     * Get tagStatus
     *
     * @return boolean 
     */
    public function getTagStatus()
    {
        return $this->tagStatus;
    }

    /**
     * Set tagCreatedDate
     *
     * @param \DateTime $tagCreatedDate
     * @return Tag
     */
    public function setTagCreatedDate($tagCreatedDate)
    {
        $this->tagCreatedDate = $tagCreatedDate;

        return $this;
    }

    /**
     * Get tagCreatedDate
     *
     * @return \DateTime 
     */
    public function getTagCreatedDate()
    {
        return $this->tagCreatedDate;
    }

    /**
     * Set tagUpdatedDate
     *
     * @param \DateTime $tagUpdatedDate
     * @return Tag
     */
    public function setTagUpdatedDate($tagUpdatedDate)
    {
        $this->tagUpdatedDate = $tagUpdatedDate;

        return $this;
    }

    /**
     * Get tagUpdatedDate
     *
     * @return \DateTime 
     */
    public function getTagUpdatedDate()
    {
        return $this->tagUpdatedDate;
    }

    /**
     * Set tagIsDeleted
     *
     * @param boolean $tagIsDeleted
     * @return Tag
     */
    public function setTagIsDeleted($tagIsDeleted)
    {
        $this->tagIsDeleted = $tagIsDeleted;

        return $this;
    }

    /**
     * Get tagIsDeleted
     *
     * @return boolean 
     */
    public function getTagIsDeleted()
    {
        return $this->tagIsDeleted;
    }

    /**
     * Add postTagInfo
     *
     * @param \OfficeBrain\Bundle\BlogBundle\Entity\PostTagInfo $postTagInfo
     * @return Tag
     */
    public function addPostTagInfo(\OfficeBrain\Bundle\BlogBundle\Entity\PostTagInfo $postTagInfo)
    {
        $this->postTagInfo[] = $postTagInfo;

        return $this;
    }

    /**
     * Remove postTagInfo
     *
     * @param \OfficeBrain\Bundle\BlogBundle\Entity\PostTagInfo $postTagInfo
     */
    public function removePostTagInfo(\OfficeBrain\Bundle\BlogBundle\Entity\PostTagInfo $postTagInfo)
    {
        $this->postTagInfo->removeElement($postTagInfo);
    }

    /**
     * Get postTagInfo
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getPostTagInfo()
    {
        return $this->postTagInfo;
    }

    /**
     * Set slug
     *
     * @param string $slug
     * @return Tag
     */
    public function setSlug($slug)
    {
        $this->slug = $slug;

        return $this;
    }

    /**
     * Get slug
     *
     * @return string 
     */
    public function getSlug()
    {
        return $this->slug;
    }
}
