title: Symfony2 unique token generator
body: <p>I'm developing a website and I need a way to create a token when the form is submitted to MySQL, it needs to be unique, like the ID column.</p>
  
  <p>For example, when I submit the form, it inserts to DB the form data plus <code>Token = TXXXXXX</code> or whatever, actually, the format will depend on some stuff, but I think I can handle it by myself, I only need the way to create that unique token inside DB...</p>
  
  <p>Does anyone knows a good way to do so?</p>
  
  <p>I've tried to generate a <code>random</code> php function to generate a number, then check against MySQL, if the number exists, generate another one until I got a non-used one, then submit... Which is slow, and obviously it is <strong>not</strong> the best way...</p>