title: Initialize custom type form data
body: <p>I have defined a custom form like this:</p>
  
  <pre><code>class EditOwnerProfileType extends AbstractType
  {
      public function buildForm(FormBuilderInterface $builder, array $options)
      {
          $builder
              -&gt;add("user", new UserType())
              -&gt;add("dog", new DogType())
              -&gt;add('save', 'submit');
      }
  
      public function getName()
      {
          return 'edit_owner';
      }
  }
  </code></pre>
  
  <p>I want to create this form and initialize it with some data like this:</p>
  
  <pre><code>    $user = new User();
      $user-&gt;setLatitude(1.1)
          -&gt;setLongitude(2.2)
          -&gt;setAddress("custom address");
  
      $dog = new Dog();
      $dog-&gt;setDogName("Bruno")
          -&gt;setDogSize("small")
          -&gt;setDogBreed("Bulldog");
  
      $formData = array(
          "user" =&gt; $user,
          "dog" =&gt; $dog
      );
  
      $form = $this-&gt;createForm(new EditOwnerProfileType(), $formData, array("csrf_protection" =&gt; false))-&gt;handleRequest($request);
  </code></pre>
  
  <p><code>DogType</code>and <code>UserType</code>only have <code>NotBlank</code> constraints</p>
  
  <p>Every time i want to validate data, it allways throws error for every field like this:</p>
  
  <pre><code>"errors": {
    "user": {
      "latitude": [
        "This value should not be blank."
      ],
      "longitude": [
        "This value should not be blank."
      ],
      "address": [
        "This value should not be blank."
      ]
    },
    "dog": {
      "dogName": [
        "This value should not be blank."
      ],
      "dogSize": [
        "This value should not be blank."
      ],
      "dogBreed": [
        "This value should not be blank."
      ]
    },
  </code></pre>
  
  <p>Isn't supposed that i'm initializing all the values? So, if user don't pass any value for this field, is initialized with the values I defined?
  Which is the correct way to initialize values on <code>EditOwnerProfileType</code> form?</p>
  
  <p>EDIT: I tried to change the form creation (just for testing), but didn't work either.</p>
  
  <pre><code>$form = $this-&gt;createForm(new EditOwnerProfileType(), $formData, array("csrf_protection" =&gt; false));
  $form-&gt;setData($formData);
  $form-&gt;handleRequest($request);
  </code></pre>
  
  <p>EDIT2: To include DogType and UserType code</p>
  
  <pre><code>class DogType extends AbstractType
  {
      public function buildForm(FormBuilderInterface $builder, array $options)
      {
          $builder
              -&gt;add('name')
              -&gt;add('dogSize')
              -&gt;add('dogBreed')            
          ;
      }    
  
      public function setDefaultOptions(OptionsResolverInterface $resolver)
      {
          $resolver-&gt;setDefaults(array(
              'data_class' =&gt; 'AppBundle\Entity\Dog',
          ));
      }
  
      public function getName()
      {
          return 'dog_type';
      }
  }
  
  class UserType extends AbstractType
  {
      public function buildForm(FormBuilderInterface $builder, array $options)
      {
          $builder
              -&gt;add('latitude')
              -&gt;add('longitude')
              -&gt;add('address')
          ;
      }
  
      public function setDefaultOptions(OptionsResolverInterface $resolver)
      {
          $resolver-&gt;setDefaults(array(
              'data_class' =&gt; 'AppBundle\Entity\User',
          ));
      }
  
      public function getName()
      {
          return 'user_type';
      }
  }
  </code></pre>
  
  <p>I'm using Symfony 2.7.9</p>