Skip to content

Instantly share code, notes, and snippets.

@tatma
Last active December 8, 2018 12:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tatma/b4b2ba5167d78871f6e7f8d3ee732127 to your computer and use it in GitHub Desktop.
Save tatma/b4b2ba5167d78871f6e7f8d3ee732127 to your computer and use it in GitHub Desktop.
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