I want to generate a unique ticket ID for my tickets. But how to let doctrine generate a unique id?
/**
* @ORM\Column(name="id", type="integer")
* @ORM\Id()
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
little more explain:
As of version 2.3, you can just add the following annotations to your property:
/**
* @ORM\Column(type="guid")
* @ORM\Id
* @ORM\GeneratedValue(strategy="UUID")
*/
protected $id;