<?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 Symfony\Component\Validator\Constraints\EmailValidator;


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

    /**
     * @var integer
     * @ORM\ManyToOne(targetEntity="Post", inversedBy="comment")
     * @ORM\JoinColumn(name="comment_post_id", referencedColumnName="id")
     */
    private $commentPostId;

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

    /**
     * @var integer
     *
     * @ORM\Column(name="comment_rating", type="integer", options={"default" = "0"})
     * 
     */
    private $commentRating;
    
    /**
     * @var integer
     *
     * @ORM\Column(name="comment_parent_id", type="integer", options={"default" = "0"})
     * 
     */
    private $commentParentId;
    
    /**
     * @var string
     *
     * @ORM\Column(name="comment_email", type="string", length=255)
     * @Assert\Regex(
     *  pattern="/^[a-zA-Z0-9_\.\+\-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+$/",
     *  match=true,
     *  message="Please enter valid email.")
     * @Assert\NotBlank(message="This field is required.")
     * 
     */
    private $commentEmail;

    /**
     * @var string
     *
     * @Assert\Url(message = "Please enter valid website url.")
     * @ORM\Column(name="comment_website", type="string", length=255)
     * 
     */
    private $commentWebsite;

    /**
     * @var boolean
     * 
     * @ORM\Column(name="comment_status", type="boolean")
     * 
     */
    private $commentStatus;

    /**
     * @var string
     *
     * @ORM\Column(name="comment_content", type="text")
     * @Assert\NotBlank(message="This field is required.")
     */
    private $commentContent;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="comment_created_date", type="datetime")
     * @Gedmo\Timestampable(on="create")
     */
    private $commentCreatedDate;
    
    /**
     * @var boolean
     *
     * @ORM\Column(name="comment_is_deleted", type="boolean",  options={"default" = "0"})
     */
    private $commentIsDeleted;


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

    /**
     * Set commentPostId
     *
     * @param integer $commentPostId
     * @return Comment
     */
    public function setCommentPostId($commentPostId)
    {
        $this->commentPostId = $commentPostId;

        return $this;
    }

    /**
     * Get commentPostId
     *
     * @return integer 
     */
    public function getCommentPostId()
    {
        return $this->commentPostId;
    }
    
    public function getCommentRating()
    {
        return $this->commentRating;
    }
    
    public function setCommentRating($commentRating)
    {
        $this->commentRating = $commentRating;
        return $this;
    }
    
    public function getCommentParentId()
    {
        return $this->commentParentId;
    }
    
    public function setCommentParentId($commentParentId)
    {
        $this->commentParentId = $commentParentId;
        return $this;
    }

    /**
     * Set commentName
     *
     * @param string $commentName
     * @return Comment
     */
    public function setCommentName($commentName)
    {
        $this->commentName = $commentName;

        return $this;
    }

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

    /**
     * Set commentEmail
     *
     * @param string $commentEmail
     * @return Comment
     */
    public function setCommentEmail($commentEmail)
    {
        $this->commentEmail = $commentEmail;

        return $this;
    }

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

    /**
     * Set commentWebsite
     *
     * @param string $commentWebsite
     * @return Comment
     */
    public function setCommentWebsite($commentWebsite)
    {
        $this->commentWebsite = $commentWebsite;

        return $this;
    }

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

    /**
     * Set commentStatus
     *
     * @param boolean $commentStatus
     * @return Comment
     */
    public function setCommentStatus($commentStatus)
    {
        $this->commentStatus = $commentStatus;

        return $this;
    }

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

    /**
     * Set commentContent
     *
     * @param string $commentContent
     * @return Comment
     */
    public function setCommentContent($commentContent)
    {
        $this->commentContent = $commentContent;

        return $this;
    }

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

    /**
     * Set commentCreatedDate
     *
     * @param \DateTime $commentCreatedDate
     * @return Comment
     */
    public function setCommentCreatedDate($commentCreatedDate)
    {
        $this->commentCreatedDate = $commentCreatedDate;

        return $this;
    }

    /**
     * Get commentCreatedDate
     *
     * @return \DateTime 
     */
    public function getCommentCreatedDate()
    {
        return $this->commentCreatedDate;
    }
    
    /**
     * Set commentIsDeleted
     *
     * @param boolean $commentIsDeleted
     * @return Post
     */
    public function setCommentIsDeleted($commentIsDeleted)
    {
        $this->commentIsDeleted = $commentIsDeleted;

        return $this;
    }

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