title: PHP Doctrine frustration: loading models doesn't work..?
body: <p>I'm almost losing it, i really hope someone can help me out!</p>
  
  <p>I'm using Doctrine with CodeIgniter. Everything is setup correctly and works until I generate the classes and view the website.</p>
  
  <blockquote>
    <p>Fatal error: Class 'BaseObjecten' not found in /var/www/vhosts/domain.com/application/models/Objecten.php on line 13</p>
  </blockquote>
  
  <p>I'm using the following bootstrapper (as CodeIgniter plugin):</p>
  
  <pre><code>&lt;?php
  // system/application/plugins/doctrine_pi.php
  
  // load Doctrine library
  require_once BASEPATH . '/plugins/Doctrine/lib/Doctrine.php';
  
  // load database configuration from CodeIgniter
  require_once APPPATH.'/config/database.php';
  
  // this will allow Doctrine to load Model classes automatically
  spl_autoload_register(array('Doctrine', 'autoload'));
  
  // we load our database connections into Doctrine_Manager
  // this loop allows us to use multiple connections later on
  foreach ($db as $connection_name =&gt; $db_values) {
  
      // first we must convert to dsn format
      $dsn = $db[$connection_name]['dbdriver'] .
          '://' . $db[$connection_name]['username'] .
          ':' . $db[$connection_name]['password'].
          '@' . $db[$connection_name]['hostname'] .
          '/' . $db[$connection_name]['database'];
  
      Doctrine_Manager::connection($dsn,$connection_name);
  }
  
  // CodeIgniter's Model class needs to be loaded
  require_once BASEPATH.'/libraries/Model.php';
  
  // telling Doctrine where our models are located
  Doctrine::loadModels(APPPATH.'/models');
  
  // (OPTIONAL) CONFIGURATION BELOW
  
  // this will allow us to use "mutators"
  Doctrine_Manager::getInstance()-&gt;setAttribute(
      Doctrine::ATTR_AUTO_ACCESSOR_OVERRIDE, true);
  
  // this sets all table columns to notnull and unsigned (for ints) by default
  Doctrine_Manager::getInstance()-&gt;setAttribute(
      Doctrine::ATTR_DEFAULT_COLUMN_OPTIONS,
      array('notnull' =&gt; true, 'unsigned' =&gt; true));
  
  // set the default primary key to be named 'id', integer, 4 bytes
  Doctrine_Manager::getInstance()-&gt;setAttribute(
      Doctrine::ATTR_DEFAULT_IDENTIFIER_OPTIONS,
      array('name' =&gt; 'id', 'type' =&gt; 'integer', 'length' =&gt; 4));
  ?&gt;
  </code></pre>
  
  <h1>Anyone?</h1>
  
  <p>p.s. I also tried adding the following right after // (OPTIONAL CONFIGURATION)</p>
  
  <pre><code>Doctrine_Manager::getInstance()-&gt;setAttribute(Doctrine::ATTR_MODEL_LOADING, Doctrine::MODEL_LOADING_CONSERVATIVE);
  spl_autoload_register(array('Doctrine', 'modelsAutoload'));
  </code></pre>