title: zf2 forms and object binding, without clearing non-passed values
body: <p>I've read through the tutorials/reference of the Form-Component in Zend-Framework 2 and maybe I missed it somehow, so I'm asking here.</p>
  
  <p>I've got an object called <code>Node</code> and bound it to a form. I'm using the <code>Zend\Stdlib\Hydrator\ArraySerializable</code>-Standard-Hydrator. So my <code>Node</code>-object has got the two methods of <code>exchangeArray()</code> and <code>getArrayCopy()</code> like this:</p>
  
  <pre><code>class Node
  {
      public function exchangeArray($data)
      {
          // Standard-Felder
          $this-&gt;node_id        = (isset($data['node_id']))   ? $data['node_id']   : null;
          $this-&gt;node_name      = (isset($data['node_name'])) ? $data['node_name'] : null;
          $this-&gt;node_body      = (isset($data['node_body'])) ? $data['node_body'] : null;
          $this-&gt;node_date      = (isset($data['node_date'])) ? $data['node_date'] : null;
          $this-&gt;node_image     = (isset($data['node_image'])) ? $data['node_image'] : null;
          $this-&gt;node_public    = (isset($data['node_public'])) ? $data['node_public'] : null;
          $this-&gt;node_type      = (isset($data['node_type'])) ? $data['node_type']:null;
          $this-&gt;node_route      = (isset($data['node_route'])) ? $data['node_route']:null;
      }
  
      public function getArrayCopy()
      {
          return get_object_vars($this);
      }
  }
  </code></pre>
  
  <p>In my Controller I've got an <code>editAction()</code>. There I want to modify the values of this <code>Node</code>-object. So I am using the <code>bind</code>-method of my form. My form has only fields to modify the <code>node_name</code> and the <code>node_body</code>-property. After validating the form and dumping the <code>Node</code>-object after submission of the form the <code>node_name</code> and <code>node_body</code>-properties now contain the values from the submitted form. However all other fields are empty now, even if they contained initial values before.</p>
  
  <pre><code>class AdminController extends AbstractActionController
  {
      public function editAction()
      {
          // ... more stuff here (getting Node, etc)             
  
          // Get Form
          $form = $this-&gt;_getForm(); // return a \Zend\Form instance
          $form-&gt;bind($node); // This is the Node-Object; It contains values for every property
  
          if(true === $this-&gt;request-&gt;isPost())
          {
              $data = $this-&gt;request-&gt;getPost();
              $form-&gt;setData($data);
  
              // Check if form is valid
              if(true === $form-&gt;isValid())
              {
                  // Dumping here....
                  // Here the Node-object only contains values for node_name and node_body all other properties are empty
                  echo'&lt;pre&gt;';print_r($node);echo'&lt;/pre&gt;';exit;
              }
          }
  
          // View
          return array(
              'form' =&gt; $form,
              'node' =&gt; $node,
              'nodetype' =&gt; $nodetype
          );
      }
  }
  </code></pre>
  
  <p>I want to only overwrite the values which are coming from the form (<code>node_name</code> and <code>node_body</code>) not the other ones. They should remain untouched.</p>
  
  <p>I think a possible solution would be to give the other properties as hidden fields into the form, however I don't wanna do this.</p>
  
  <p>Is there any possibility to not overwrite values which are not present within the form?</p>