title: zf2 form collection binding
body: <p>Please, explain me how i can bind values to such a form:</p>
  
  <pre><code>&lt;?php
  
  namespace ZfcAdmin\Form;
  
  use Zend\Form\Form;
  use Zend\Form\Element;
  
  class FeelistUploadForm extends Form {
          public function __construct($objectManager) {
  
                  parent::__construct('feelist');
  
                  $this-&gt;setAttribute('method', 'post');
                  $this-&gt;setAttribute('class', 'form');
  
                  $fieldset = new FeelistFieldset($objectManager);
                  $fieldset-&gt;setUseAsBaseFieldset(true);
                  $this-&gt;add(array(
                          'type' =&gt; 'Zend\Form\Element\Collection',
                          'name' =&gt; 'feelist',
                          'options' =&gt; array(
                                  'label' =&gt; 'fee list',
                                  'should_create_template' =&gt; true,
                                  'allow_add' =&gt; true,
                                  'target_element' =&gt; $fieldset,
                          ),
                  ));
  
  
                  $this-&gt;add(array(
                          'name' =&gt; 'submit',
                          'type' =&gt; 'Submit',
                          'attributes' =&gt; array(
                                  'value' =&gt; 'Save',
                                  'id' =&gt; 'submitbutton',
                                  'class' =&gt; 'button',
                          ),
                  ));
  
          }
  }
  </code></pre>
  
  <p>and the fieldset</p>
  
  <pre><code> class FeelistFieldset extends Fieldset implements InputFilterProviderInterface {
  
          public function __construct($objectManager, $options = array()) {
                 $this-&gt;setHydrator(new DoctrineHydrator($objectManager, 'InsurancyProduct\Entity\Feelist'))
                          -&gt;setObject(new Feelist());
                  parent::__construct('feelist');
  
                   $this-&gt;add(array(
                          'name' =&gt; 'id',
                          'type' =&gt; 'Hidden',
                   ));
  
  
                  $this-&gt;add(array(
                          'name' =&gt; 'csv',
                          'type' =&gt; 'Zend\Form\Element\File',
                          'options' =&gt; array(
                                  'label' =&gt; 'csv',
                          ),
                  ));
  
  
                   $this-&gt;add(array(
                          'type' =&gt; 'text',
                          'name' =&gt; 'valid_from',
                          'options' =&gt; array(
                                  'label' =&gt; 'valid from',
                          ),
                          'attributes'=&gt; array(
                                  'id' =&gt; 'validfrom',
                          ),
                   ));
  
  
          }
  
       public function getInputFilterSpecification()
       {
           return array(
           );
       }
  
  
   }
  </code></pre>
  
  <p>in the controller i use </p>
  
  <pre><code>$feelist_form = new \ZfcAdmin\Form\FeelistUploadForm($objectManager);
  $feelist_form-&gt;bind( new feelist());
  </code></pre>
  
  <p>and i can get values for bind in controller like this</p>
  
  <pre><code>                $feelist = $objectManager
                          -&gt;getRepository('InsurancyProduct\Entity\Feelist')
                          -&gt;findBy(array('product_id' =&gt; $id));
  </code></pre>
  
  <p>i can't bind it to form, it's array of objects, but form recieves only single object.
  form is of course empty and i dont know how to bind this values to form. Please, dont send me to RFTM, I have been reading it for last 48 hours, about zf2 hydration, forms, etc :(</p>