Entity/Comment.php
<?php
/*
* Copyright 2014-2016 Arnaud Bienvenu
*
* This file is part of Kyela.
* Kyela is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* Kyela is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
* You should have received a copy of the GNU Affero General Public License
* along with Kyela. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace Abienvenu\KyelaBundle\Entity;
use Symfony\Component\Validator\Constraints as Assert;
use Doctrine\ORM\Mapping as ORM;
/**
* Comment
*
* @ORM\Table()
* @ORM\Entity(repositoryClass="Abienvenu\KyelaBundle\Entity\CommentRepository")
*/
class Comment extends Entity
{
/**
* @var integer
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="author", type="string", length=255)
*/
private $author;
/**
* @var string
*
* @ORM\Column(name="content", type="string", length=5000)
* @Assert\NotBlank()
*/
private $content;
/**
* @var \DateTime
*
* @ORM\Column(name="datetime", type="datetime")
*/
private $datetime;
/**
* @ORM\ManyToOne(targetEntity="Poll", inversedBy="comments")
*/
private $poll;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set author
*
* @param string $author
* @return Comment
*/
public function setAuthor($author)
{
$this->author = $author;
return $this;
}
/**
* Get author
*
* @return string
*/
public function getAuthor()
{
return $this->author;
}
/**
* 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 datetime
*
* @param \DateTime $datetime
* @return Comment
*/
public function setDatetime($datetime)
{
$this->datetime = $datetime;
return $this;
}
/**
* Get datetime
*
* @return \DateTime
*/
public function getDatetime()
{
return $this->datetime;
}
/**
* Set poll
*
* @param Poll $poll
* @return Comment
*/
public function setPoll(Poll $poll = null)
{
$this->poll = $poll;
return $this;
}
/**
* Get poll
*
* @return Poll
*/
public function getPoll()
{
return $this->poll;
}
}