Created
September 23, 2015 18:11
-
-
Save vaneves/aa2b1cc0b1a79f0d5b54 to your computer and use it in GitHub Desktop.
Curso Ninja - Classe Post
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Entities; | |
use Doctrine\ORM\Mapping as ORM; | |
/** | |
* @ORM\Entity | |
* @ORM\Table(name="posts") | |
**/ | |
class Post | |
{ | |
/** | |
* @ORM\Id | |
* @ORM\Column(type="integer") | |
* @ORM\GeneratedValue(strategy="AUTO") | |
*/ | |
protected $id; | |
/** | |
* @ORM\Column(type="string") | |
*/ | |
protected $title; | |
/** | |
* @ORM\Column(type="datetime") | |
*/ | |
protected $date; | |
/** | |
* @ORM\Column(type="string") | |
*/ | |
protected $content; | |
public function __construct() | |
{ | |
$this->date = new \DateTime('now'); | |
} | |
public function getId() | |
{ | |
return $this->id; | |
} | |
public function getTitle() | |
{ | |
return $this->title; | |
} | |
public function setTitle($title) | |
{ | |
$this->title = $title; | |
} | |
public function getDate() | |
{ | |
return $this->date->format('d/m/Y'); | |
} | |
public function getContent() | |
{ | |
return $this->content; | |
} | |
public function setContent($content) | |
{ | |
$this->content = $content; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment