title: using codeigniter PHP Fatal error: Class 'MY_Model' not found
body: <p>Now I am learning CodeIgniter_2.1.4 but I got a php error;</p>
  
  <p>I have a my_model.php file in /data/www/application/core</p>
  
  <pre><code>&lt;?php
  
  class MY_Model extends CI_Model {
     const DB_TABLE = 'abstract';
     const DB_TABLE_PK = 'abstract';
  
     private function insert() {
        $this-&gt;db-&gt;insert($this::DB_TABLE, $this);
        $this-&gt;{$this::DB_TABLE_PK} = $this-&gt;db-&gt;insert_id();
     }
  
     private function update() {
        $this-&gt;db-&gt;update($this::DB_TABLE, $this, $this::DB_TABLE_PK);
     }
  
     public function populate($row) {
        foreach($row as $key =&gt; $value) {
           $this-&gt;$key = $value;
        }
     }
  
     public function load($id) {
        $query = $this-&gt;db-&gt;get_where($this::DB_TABLE, array(
           $this::DB_TABLE_PK =&gt; $id,
        ));
        $this-&gt;populate($query-&gt;row());
     }
  
     public function delete(){
        $this-&gt;db-&gt;delete($this::DB_TABLE, array(
           $this::DB_TABLE_PK =&gt; $this-&gt;{$this::DB_TABLE_PK},
        ));
        unset($this-&gt;{$this::DB_TABLE_PK});
     }
  
     public function save(){
        if(isset($this-&gt;{$this::DB_TABLE_PK})) {
           $this-&gt;update();
        }
        else {
           $this-&gt;insert();
        }
     }
  
   public function get($limit = 0, $offset = 0) {
        if($limit) {
            $query = $this-&gt;db-&gt;get($this::DB_TABE, $limit, $offset);
        }
        else {
            $query = $this-&gt;db-&gt;get($this::DB_TABLE);
        }
  
        $ret_val = array();
        $class = get_class($this);
        foreach ($query-&gt;result() as $row) {
            $model = new $class;
            $model-&gt;populate($row);
            $ret_val[$row-&gt;{$this::DB_TABLE_PK}] = $model;
        }
        return $ret_val;
     }
  }
  </code></pre>
  
  <p>and my domain model is :</p>
  
  <pre><code>&lt;?php
  
  class Publication extends MY_Model {
  
      const DB_TABLE = 'publications';
      const DB_TABLE_PK = 'publication_id';
  
      public $publication_id;
      public $publication_name;
  
  }
  </code></pre>
  
  <p>well when I get model in my controller I got this php error:</p>
  
  <pre><code>PHP Fatal error:  Class 'MY_Model' not found in /data/www/application/models/publication.php on line 3
  </code></pre>
  
  <p>I have tried two hours finding the reason but failed ):</p>