199 lines
3.2 KiB
PHP
199 lines
3.2 KiB
PHP
<?php
|
|
namespace GergelyPolonkai\FrontBundle\Entity;
|
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
/**
|
|
* @ORM\Entity
|
|
* @ORM\Table(name="comments")
|
|
*/
|
|
class Comment
|
|
{
|
|
/**
|
|
* @ORM\Id
|
|
* @ORM\GeneratedValue(strategy="AUTO")
|
|
* @ORM\Column(type="integer")
|
|
*/
|
|
private $id;
|
|
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity="Post")
|
|
* @ORM\JoinColumn(nullable=false)
|
|
*/
|
|
private $post;
|
|
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity="User")
|
|
* @ORM\JoinColumn(nullable=true)
|
|
*/
|
|
private $user;
|
|
|
|
/**
|
|
* @ORM\Column(type="datetime", nullable=false)
|
|
*/
|
|
private $createdAt;
|
|
|
|
/**
|
|
* @ORM\Column(type="string", length=150, nullable=true)
|
|
*/
|
|
private $subject;
|
|
|
|
/**
|
|
* @ORM\Column(type="boolean", nullable=false)
|
|
*/
|
|
private $hidden;
|
|
|
|
/**
|
|
* @ORM\Column(type="text", nullable=false)
|
|
*/
|
|
private $content;
|
|
|
|
/**
|
|
* Get id
|
|
*
|
|
* @return integer
|
|
*/
|
|
public function getId()
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
/**
|
|
* Set createdAt
|
|
*
|
|
* @param \DateTime $createdAt
|
|
* @return Comment
|
|
*/
|
|
public function setCreatedAt($createdAt)
|
|
{
|
|
$this->createdAt = $createdAt;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get createdAt
|
|
*
|
|
* @return \DateTime
|
|
*/
|
|
public function getCreatedAt()
|
|
{
|
|
return $this->createdAt;
|
|
}
|
|
|
|
/**
|
|
* Set subject
|
|
*
|
|
* @param string $subject
|
|
* @return Comment
|
|
*/
|
|
public function setSubject($subject)
|
|
{
|
|
$this->subject = $subject;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get subject
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getSubject()
|
|
{
|
|
return $this->subject;
|
|
}
|
|
|
|
/**
|
|
* Set hidden
|
|
*
|
|
* @param boolean $hidden
|
|
* @return Comment
|
|
*/
|
|
public function setHidden($hidden)
|
|
{
|
|
$this->hidden = $hidden;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get hidden
|
|
*
|
|
* @return boolean
|
|
*/
|
|
public function getHidden()
|
|
{
|
|
return $this->hidden;
|
|
}
|
|
|
|
/**
|
|
* 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 post
|
|
*
|
|
* @param GergelyPolonkai\FrontBundle\Entity\Post $post
|
|
* @return Comment
|
|
*/
|
|
public function setPost(\GergelyPolonkai\FrontBundle\Entity\Post $post)
|
|
{
|
|
$this->post = $post;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get post
|
|
*
|
|
* @return GergelyPolonkai\FrontBundle\Entity\Post
|
|
*/
|
|
public function getPost()
|
|
{
|
|
return $this->post;
|
|
}
|
|
|
|
/**
|
|
* Set user
|
|
*
|
|
* @param GergelyPolonkai\FrontBundle\Entity\User $user
|
|
* @return Comment
|
|
*/
|
|
public function setUser(\GergelyPolonkai\FrontBundle\Entity\User $user = null)
|
|
{
|
|
$this->user = $user;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get user
|
|
*
|
|
* @return GergelyPolonkai\FrontBundle\Entity\User
|
|
*/
|
|
public function getUser()
|
|
{
|
|
return $this->user;
|
|
}
|
|
}
|