title: Zend framework - Why should I use data mapper / Db_Table_Row?
body: <p><strong>Extended Question: Why should I use data mapper / Db_Table_Row, where as DbTable is capable of handling most of the basic tasks for data manipulation.</strong></p>
  
  <p>I am currently learning ZF v1.11</p>
  
  <p>For Database manipulation, I created DbTable for each tables. For example, "users" table is represented by Application_Model_DbTable_Users with no additional codes in there.</p>
  
  <p>When manipulating data, I can use:</p>
  
  <pre><code>&lt;?php
  $uTable = new Application_Model_DbTable_Users();
  $newUid = $uTable-&gt;insert(array('name'=&gt;'Old Name', 'email'=&gt;''));
  $user = $uTable-&gt;find($newUid)-&gt;current();
  
  // Then I can use $user which is instance of Table_Row
  $user-&gt;name = "New Name";
  $user-&gt;email = "email@addr.com";
  $user-&gt;save();
  </code></pre>
  
  <p>My Question is, when would I need to define a row class (assuming Table_Row is referred as DataMapper in ZF-Tutorials)</p>
  
  <pre><code>// By, adding this to the DbTable class
  protected $_rowClass = 'Application_Model_User';
  </code></pre>
  
  <p>What are the benefits of having a Row class for each entity? Can anyone point me to best practices for this.</p>