title: Zend framework 2 edit album not working
body: <p>I am getting PDOException in edit album "SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'artist' cannot be null". I debugged the code and found that after edit form action runs all the column(id,title,artist) values change to the null value in the insert statement, whereas it should be POST values of the edit form. I am using the same code as of ZF2 tutorial. 
  $request->getPost() has correct edited values but $form->getData() returns empty form post values for (id,title,artist).</p>
  
  <p>can anybody please help.</p>
  
  <p>My code is:</p>
  
  <pre><code>public function editAction()
  {
      $id = (int) $this-&gt;params()-&gt;fromRoute('id', 0);
      if (!$id) {
          return $this-&gt;redirect()-&gt;toRoute('album', array(
              'action' =&gt; 'add'
          ));
      }
      $album = $this-&gt;getAlbumTable()-&gt;getAlbum($id);
  
      $form  = new AlbumForm();
      $form-&gt;bind($album);
      $form-&gt;get('submit')-&gt;setAttribute('value', 'Edit');
  
      $request = $this-&gt;getRequest();
      if ($request-&gt;isPost()) {
          $form-&gt;setInputFilter($album-&gt;getInputFilter());
          $form-&gt;setData($request-&gt;getPost());
  
          if ($form-&gt;isValid()) {
              $this-&gt;getAlbumTable()-&gt;saveAlbum($form-&gt;getData());
  
              // Redirect to list of albums
              return $this-&gt;redirect()-&gt;toRoute('album');
          }
      }
  
      return array(
          'id' =&gt; $id,
          'form' =&gt; $form,
      );
  }
  </code></pre>