title: Generate unique id - doctrine - symfony2
body: <p>I want to generate a unique ticket ID for my tickets. But how to let doctrine generate a unique id?</p>
  
  <pre><code>/**
   * @ORM\Column(name="id", type="integer")
   * @ORM\Id()
   * @ORM\GeneratedValue(strategy="AUTO")
   */
  protected $id;
  </code></pre>
  
  <p>little more explain:</p>
  
  <ul>
  <li>id must be 6 charters like: 678915</li>
  <li>id must be unique </li>
  </ul>