Permalink
Fetching contributors…
Cannot retrieve contributors at this time
129 lines (111 sloc) 1.99 KB
<?php
namespace Blog\ExampleBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Post
*
* @ORM\Table()
* @ORM\Entity(repositoryClass="Blog\ExampleBundle\Entity\PostRepository")
*/
class Post
{
/**
* @var integer
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="title", type="string", length=255)
*/
private $title;
/**
* @var string
*
* @ORM\Column(name="content", type="text")
*/
private $content;
/**
* @var \DateTime
*
* @ORM\Column(name="publishDate", type="datetime")
*/
private $publishDate;
public function __construct()
{
$this->setPublishDate(new \DateTime('now'));
}
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set title
*
* @param string $title
* @return Post
*/
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 Post
*/
public function setContent($content)
{
$this->content = $content;
return $this;
}
/**
* Get content
*
* @return string
*/
public function getContent()
{
return $this->content;
}
/**
* Set publishDate
*
* @param \DateTime $publishDate
* @return Post
*/
public function setPublishDate($publishDate)
{
$this->publishDate = $publishDate;
return $this;
}
/**
* Get publishDate
*
* @return \DateTime
*/
public function getPublishDate()
{
return $this->publishDate;
}
}