Skip to content

Instantly share code, notes, and snippets.

@tatma tatma/Article.php
Last active Dec 8, 2018

Embed
What would you like to do?
Article with getters and setters
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Article
*
* @ORM\Table(name="articles")
* @ORM\Entity
*/
class Article
{
/**
* @ORM\Id
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var String
*
* @ORM\Column(name="title", type="string", length=255)
*/
private $title;
/**
* @var string
*
* @ORM\Column(name="slug", type="string", length=100, unique=true)
*/
private $slug;
/**
* @var string
*
* @ORM\Column(name="content", type="text")
*/
private $content;
/**
* @var datetime
*
* @ORM\Column(name="creation_datetime", type="datetime", nullable=false)
*/
private $creationDateTime;
/**
* @var datetime
*
* @ORM\Column(name="last_modification_datetime", type="datetime", nullable=true)
*/
private $lastModificationDateTime;
public function getId()
{
return $this->id;
}
public function setTitle($title)
{
$this->title = $title;
}
public function getTitle()
{
return $this->title;
}
public function setSlug($slug)
{
$this->slug = $slug;
}
public function getSlug()
{
return $this->slug;
}
public function setContent($content)
{
$this->content = $content;
}
public function getContent()
{
return $this->content;
}
public function setCreationDateTime($creationDateTime)
{
$this->creationDateTime = $creationDateTime;
}
public function getCreationDateTime()
{
return $this->creationDateTime;
}
public function setLastModificationDateTime($lastModificationDateTime)
{
$this->lastModificationDateTime = $lastModificationDateTime;
}
public function getLastModificationDateTime()
{
return $this->lastModificationDateTime;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.