Skip to content

Instantly share code, notes, and snippets.

@tatma
Last active December 8, 2018 12:45
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/b4fee1fcb7534de336f42021e2e9ce07 to your computer and use it in GitHub Desktop.
Save tatma/b4fee1fcb7534de336f42021e2e9ce07 to your computer and use it in GitHub Desktop.
Basic Entity (properties, no methods)
<?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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment