<?php

namespace App\Entity;

use Gedmo\Mapping\Annotation as Gedmo;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\ExecutionContext;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\HttpFoundation\File\File;
use App\Entity\User;
use App\Entity\Document;
use App\EntityProfile;
use App\Entity\Category;

use JMS\Serializer\Annotation\ExclusionPolicy;
use JMS\Serializer\Annotation\Expose;
use JMS\Serializer\Annotation\Groups;
use JMS\Serializer\Annotation\VirtualProperty;

use EWZ\Bundle\RecaptchaBundle\Validator\Constraints as Recaptcha;

/**
 * @ORM\Table(name="comment")
 * @ORM\Entity
 * @ORM\Entity(repositoryClass="App\Entity\CommentRepository")
 * @ORM\HasLifecycleCallbacks
 * @ExclusionPolicy("all") 
 */
class Comment
{
    /**
     * @ORM\Column(type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * @ORM\ManyToOne(targetEntity="App\Entity\Profile")
     * @ORM\JoinColumn(name="author_id", referencedColumnName="id")
     * @Expose
     **/
    protected $author;

    /**
     * @ORM\ManyToOne(targetEntity="App\Entity\Reply")
     * @ORM\JoinColumn(name="reply_id", referencedColumnName="id")
     * @Expose
     **/
    protected $reply;

    /**
     * @ORM\ManyToOne(targetEntity="App\Entity\Profile")
     * @ORM\JoinColumn(name="profile_id", referencedColumnName="id")
     * @Expose
     **/
    protected $profile;

    /**
     * @ORM\ManyToOne(targetEntity="App\Entity\Showcase")
     * @ORM\JoinColumn(name="showcase_id", referencedColumnName="id")
     * @Expose
     **/
    protected $showcase;


    /**
     * @ORM\ManyToOne(targetEntity="App\Entity\Blog")
     * @ORM\JoinColumn(name="blog_id", referencedColumnName="id")
     * @Expose
     **/
    protected $blog;

    /**
     * @var string $title
     *
     * @ORM\Column(name="title", type="string", nullable=true)
     * @Expose
     */
    private $title;

    /**
     * @var string $name
     *
     * @ORM\Column(name="name", type="string", nullable=true)
     * @Expose
     */
    private $name;

    /**
     * @var string $website
     *
     * @ORM\Column(name="website", type="string", nullable=true)
     * @Expose
     */
    private $website;

    /**
     * @var string $email
     *
     * @ORM\Column(name="email", type="string", nullable=true)
     * @Expose
     */
    private $email;

    /**
     * @var string $content
     *
     * @ORM\Column(name="content", type="text", nullable=true)
     */
    private $content;

    /**
     * @Recaptcha\IsTrue
     */
    public $recaptcha;

    /**
     * @Gedmo\Timestampable(on="create")
     * @Doctrine\ORM\Mapping\Column(type="datetime")
     */
    private $created;

    /**
     * @var \DateTime $updated
     *
     * @Gedmo\Timestampable(on="update")
     * @ORM\Column(type="datetime")
     */
    private $modified;    

    public function __toString() {
        return $this->title;
    }
    
    /**
     * @var integer
     *
     * @ORM\Column(name="status", type="boolean", nullable=true)
     */
    private $status = true;


    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set title
     *
     * @param string $title
     *
     * @return Comment
     */
    public function setTitle($title)
    {
        $this->title = $title;

        return $this;
    }

    /**
     * Get title
     *
     * @return string
     */
    public function getTitle()
    {
        return $this->title;
    }

    /**
     * Set content
     *
     * @param string $content
     *
     * @return Comment
     */
    public function setContent($content)
    {
        $this->content = $content;

        return $this;
    }

    /**
     * Get content
     *
     * @return string
     */
    public function getContent()
    {
        return $this->content;
    }

    /**
     * Set created
     *
     * @param \DateTime $created
     *
     * @return Comment
     */
    public function setCreated($created)
    {
        $this->created = $created;

        return $this;
    }

    /**
     * Get created
     *
     * @return \DateTime
     */
    public function getCreated()
    {
        return $this->created;
    }

    /**
     * Set modified
     *
     * @param \DateTime $modified
     *
     * @return Comment
     */
    public function setModified($modified)
    {
        $this->modified = $modified;

        return $this;
    }

    /**
     * Get modified
     *
     * @return \DateTime
     */
    public function getModified()
    {
        return $this->modified;
    }

    /**
     * Set status
     *
     * @param boolean $status
     *
     * @return Comment
     */
    public function setStatus($status)
    {
        $this->status = $status;

        return $this;
    }

    /**
     * Get status
     *
     * @return boolean
     */
    public function getStatus()
    {
        return $this->status;
    }

    /**
     * Set author
     *
     * @param \App\Entity\Profile $author
     *
     * @return Comment
     */
    public function setAuthor(\App\Entity\Profile $author = null)
    {
        $this->author = $author;

        return $this;
    }

    /**
     * Get author
     *
     * @return \App\Entity\Profile
     */
    public function getAuthor()
    {
        return $this->author;
    }

    /**
     * Set reply
     *
     * @param \App\Entity\Reply $reply
     *
     * @return Comment
     */
    public function setReply(\App\Entity\Reply $reply = null)
    {
        $this->reply = $reply;

        return $this;
    }

    /**
     * Get reply
     *
     * @return \App\Entity\Reply
     */
    public function getReply()
    {
        return $this->reply;
    }

    /**
     * Set profile
     *
     * @param \App\Entity\Profile $profile
     *
     * @return Comment
     */
    public function setProfile(\App\Entity\Profile $profile = null)
    {
        $this->profile = $profile;

        return $this;
    }

    /**
     * Get profile
     *
     * @return \App\Entity\Profile
     */
    public function getProfile()
    {
        return $this->profile;
    }

    /**
     * Set showcase
     *
     * @param \App\Entity\Showcase $showcase
     *
     * @return Comment
     */
    public function setShowcase(\App\Entity\Showcase $showcase = null)
    {
        $this->showcase = $showcase;

        return $this;
    }

    /**
     * Get showcase
     *
     * @return \App\Entity\Showcase
     */
    public function getShowcase()
    {
        return $this->showcase;
    }

    /**
     * Set blog
     *
     * @param \App\Entity\Blog $blog
     *
     * @return Comment
     */
    public function setBlog(\App\Entity\Blog $blog = null)
    {
        $this->blog = $blog;

        return $this;
    }

    /**
     * Get blog
     *
     * @return \App\Entity\Blog
     */
    public function getBlog()
    {
        return $this->blog;
    }

    /**
     * Set name
     *
     * @param string $name
     *
     * @return Comment
     */
    public function setName($name)
    {
        $this->name = $name;

        return $this;
    }

    /**
     * Get name
     *
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Set website
     *
     * @param string $website
     *
     * @return Comment
     */
    public function setWebsite($website)
    {
        $this->website = $website;

        return $this;
    }

    /**
     * Get website
     *
     * @return string
     */
    public function getWebsite()
    {
        return $this->website;
    }

    /**
     * Set email
     *
     * @param string $email
     *
     * @return Comment
     */
    public function setEmail($email)
    {
        $this->email = $email;

        return $this;
    }

    /**
     * Get email
     *
     * @return string
     */
    public function getEmail()
    {
        return $this->email;
    }
}
