title: Symfony 2 - Sluggable not set when using form
body: <p>I am trying to use the Sluggable behaviour from the Doctrine Extensions bundle:</p>
  
  <p><a href="http://gediminasm.org/article/sluggable-behavior-extension-for-doctrine-2">http://gediminasm.org/article/sluggable-behavior-extension-for-doctrine-2</a></p>
  
  <p>I have set up a sluggable field in my entity using annotation but the value does not get set when I use a form to create an instance, which causes the following error:</p>
  
  <blockquote>
    <p>SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'slug' cannot be null</p>
  </blockquote>
  
  <p>Here's the code from my controller:</p>
  
  <pre><code>        $form = $this-&gt;createFormBuilder($section)
                          -&gt;add('title', 'text')
                          -&gt;getForm();
  
          if ($request-&gt;getMethod() == 'POST') {
          $form-&gt;bindRequest($request);
  
              if ($form-&gt;isValid()) {
  
                  $em = $this-&gt;getDoctrine()-&gt;getEntityManager();
                  $em-&gt;persist($section);
                  $em-&gt;flush();
  
                  if (empty($id)) {
                      return $this-&gt;redirect($this-&gt;generateUrl('ContentBundle_section_new'));
                  }
                  else {
                      return $this-&gt;redirect($this-&gt;generateUrl('ContentBundle_section_edit', array('id' =&gt; $id)));
                  }
  
              }
          }
  </code></pre>
  
  <p>And the sluggable field definition in the Entity class:</p>
  
  <pre><code>    /**
       * @Gedmo\Slug(fields={"title"})
       * @ORM\Column(length=128, unique=true)
       */
      private $slug;
  </code></pre>
  
  <p>If I add the slug field to the formbuilder and set a value manually, it works OK but obviously I don't want to be messing around with this.  </p>
  
  <p>Can anyone help?</p>
  
  <p>Thanks</p>