title: Fatal Error: Class 'User' not found - Doctrine2/CodeIgniter2
body: <p>I keep getting the following error when trying to run a login script I have. I have created an Entities folder based on my already in place db schema.</p>
  
  <pre><code>Fatal error: Class 'User' not found in /xxxx/xxxxx/public_html/application/controllers/signup.php on line 23
  </code></pre>
  
  <p>Code: 
          
  
  <pre><code>    public function __construct() {
          parent::__construct();
  
          $this-&gt;load-&gt;helper(array('form','url'));
          $this-&gt;load-&gt;library('form_validation');
      }
  
      public function index() {
          $this-&gt;load-&gt;view('login_form');
      }
  
      public function submit() {
  
          if ($this-&gt;_submit_validate() === FALSE) {
              $this-&gt;index();
              return;
          }
  
          redirect('/');
  
      }
  
      private function _submit_validate() {
  
          $this-&gt;form_validation-&gt;set_rules('UserName', 'Username', 
              'trim|required|callback_authenticate');
  
          $this-&gt;form_validation-&gt;set_rules('Password', 'Password',
              'trim|required');
  
          $this-&gt;form_validation-&gt;set_message('authenticate','Invalid login. Please try again.');
  
          return $this-&gt;form_validation-&gt;run();
  
      }
  
      public function authenticate() {
  
          return Current_User::login($this-&gt;input-&gt;post('UserName'), 
                                      $this-&gt;input-&gt;post('Password'));
  
      }
  }
  </code></pre>