title: Symfony2 passing values to collection form type
body: <p>I have the following entity relations:</p>
  
  <ul>
  <li>A Customer has one-to-many Address</li>
  <li>An Address has many-to-one County and many-to-one City</li>
  <li>A County has one-to-many City.</li>
  </ul>
  
  <p>So, in my CustomerType, I have</p>
  
  <pre><code>public function buildForm(FormBuilderInterface $builder, array $options)
  {
      $builder
          ...
          -&gt;add('addresss', 'collection', array(
              'label' =&gt; 'customer.address',
              'type' =&gt; new AddressType(),
              'allow_add' =&gt; true,
              'allow_delete' =&gt; true,
              'by_reference' =&gt; false,
          ))
      ;
  }
  </code></pre>
  
  <p>And in my AddressType, I have</p>
  
  <pre><code>public function buildForm(FormBuilderInterface $builder, array $options)
  {
      $builder
          ...
          -&gt;add('city', 'entity', array(
              'class' =&gt; 'MyCustomerBundle:City',
              'query_builder' =&gt; function(CityRepository $cr) use ($options) {
                  return $cr-&gt;getCityQB($options['county']);
              },
              'property' =&gt; 'city',
              'empty_value' =&gt; '',
          ))
      ;
  }
  </code></pre>
  
  <p>My goal is to only display the set of cities for their corresponding county. I can get the values into CustomerType from $options but how can I pass down the values to AddressType? So that each address gets its corresponding county to look up the cities?</p>
  
  <p>Any help would be appreciated. Thanks!</p>