Skip to content

Instantly share code, notes, and snippets.

@Digi92
Last active April 15, 2017 21:00
Show Gist options
  • Select an option

  • Save Digi92/2cbc284686b7104cd3611a72b2bf1230 to your computer and use it in GitHub Desktop.

Select an option

Save Digi92/2cbc284686b7104cd3611a72b2bf1230 to your computer and use it in GitHub Desktop.
Doctrine Example ID Field Annotation Configuration
<?php
namespace AppBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Class Example
* @package AppBundle\Entity
* @ORM\Entity
* @ORM\Table(name="example")
*/
class Example {
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
* @var integer
*/
private $id;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment