title: Doctrine 1.2 models returning integer fields as string values using Zend Framework and MySQL 5
body: <p>Any idea why my Doctrine 1.2 models are returning <em>string</em> values for <em>integer</em>-defined fields?</p>
  
  <p>Base model defined as:</p>
  
  <pre><code>abstract class Kwis_Model_Base_User extends Doctrine_Record
  {
      public function setTableDefinition()
      {
          $this-&gt;setTableName('user');
          $this-&gt;hasColumn('id', 'integer', 4, array(
               'unsigned' =&gt; true,
               'primary' =&gt; true,
               'autoincrement' =&gt; true,
               ));
  
          // more fields
          // ...
      }
  </code></pre>
  
  <p>Table Model is defined as:</p>
  
  <pre><code>class Kwis_Model_UserTable extends Kwis_Model_BaseTable
  {
  
      /**
       * Returns an instance of this class.
       *
       * @return object Kwis_Model_UserTable
       */
      public static function getInstance()
      {
          $table = Doctrine_Core::getTable('Kwis_Model_User');
          return $table;
      }
  
      // other methods
      // ...
  }
  </code></pre>
  
  <p>Sample controller code:</p>
  
  <pre><code>class TestController extends Zend_Controller_Action
  {
      public function indexAction()
      {
          $userTable = Kwis_Model_UserTable::getInstance();
          $user = $userTable-&gt;find(1);
          echo "&lt;pre&gt;" . var_dump($user-&gt;id) . "&lt;/pre&gt;"; die();
      }
  }
  </code></pre>
  
  <p>Produced output:</p>
  
  <pre><code> string '1' (length=1)
  </code></pre>
  
  <p>Any ideas, greatly appreciated. ;-)</p>