title: Symfony2: Questions about forms and validation
body: <p>I have multistage user signup and I seem to be missing something.</p>
  
  <p>I have a user entity and some other data embedded in the form which I want to collect as well.  For the sake of an example we will say User has name and email and these map to fields on the user entity.  On the same form I also have device data as a hidden field.</p>
  
  <p>On my User entity i have a validation group 'plan' so when I submit I do something like this:</p>
  
  <pre><code>&lt;?php
  $user = new User();
  $form = $this-&gt;createFormBuilder($user, array('validation_groups' =&gt; array('plan'))
      -&gt;add('name')
      -&gt;add('email')
      -&gt;getForm();
  
  $form-&gt;handleRequest($request)
  if ($form-&gt;isValid()) {
      $user = $form-&gt;getData();
      $em-&gt;persist($user);
      $em-&gt;flush();
  } else {
      return $this-&gt;render('myform.html.twig', array('form' =&gt; $form-&gt;createView()));
  }
  </code></pre>
  
  <p>This is mostly rough psuedocode but now when I call $form->getData() or $request->request->all(), device_data is stripped out and no where to be found.  I can get around this by not passing $user into createFormBuilder as the first argument but then my validation group doesn't seem to happen because it is bound to the user entity.  Is there a way around this?</p>