title: ErrorException [ Notice ]: Undefined property: Model_Album::$db
body: <p>I'm trying to do a simple <code>MVC</code> interface using Kohana framework 3.3.</p>
  
  <p>I've modified the bootstrap to:</p>
  
  <pre><code>'controller' =&gt; 'Album',
  'action'     =&gt; 'index',
  </code></pre>
  
  <p>album controller:</p>
  
  <pre><code>&lt;?php defined('SYSPATH') OR die('No direct access allowed.');
  
  class Controller_Album extends Controller
  {
   private $album_model; 
   private $genre_model;
  
   private $list_view;
   private $create_view;
   private $update_view;
  
  public function __construct(Request $request, Response $response)    
   { 
      parent::__construct($request, $response);
      $this-&gt;album_model   = new Model_Album;
      $this-&gt;genre_model      = new Model_Genre;
        $this-&gt;list_view       = new View('List');
        $this-&gt;update_view      = new View('Update');
        $this-&gt;create_view      = new View('Create');
  }
  
   public function action_index()
   {
        $this-&gt;show_albums_list();
   }
  
  private function show_albums_list()
  {
      $albums_list = $this-&gt;album_model-&gt;get_list(); 
      $this-&gt;list_view-&gt;set('albums_list',$albums_list);
      $this-&gt;list_view-&gt;render(TRUE); 
  }
  
   public function show_create_editor()
   {
       $this-&gt;create_view-&gt;set('genres_list',$this-&gt;get_genres_list());
         $this-&gt;create_view-&gt;render(TRUE);
   }
  
   public function show_update_editor($id)
   {
      $album_data = $this-&gt;album_model-&gt;read($id);
      $this-&gt;update_view-&gt;set('album_id',$album_data[0]-&gt;id);
      $this-&gt;update_view-&gt;set('name',$album_data[0]-&gt;name);
      $this-&gt;update_view-&gt;set('author',$album_data[0]-&gt;author);
      $this-&gt;update_view-&gt;set('genre_id',$album_data[0]-&gt;genre_id);
      $this-&gt;update_view-&gt;set('genres_list',$this-&gt;get_genres_list());
      $this-&gt;update_view-&gt;render(TRUE);
   }
  
   public function create()
   { 
      $album_data=array(
      'name'        =&gt; $this-&gt;input-&gt;post('name'),
      'author'      =&gt; $this-&gt;input-&gt;post('author'),
      'genre_id'  =&gt; $this-&gt;input-&gt;post('genre_id')
      );
      $this-&gt;album_model-&gt;create($album_data);
      url::redirect('Album');
   }
  
  public function update()
  { 
      $album_data = array(
          'name'        =&gt; $this-&gt;input-&gt;post('name'),
          'author'      =&gt; $this-&gt;input-&gt;post('author'),
          'genre_id'  =&gt; $this-&gt;input-&gt;post('genre_id')
      );
      $this-&gt;album_model-&gt;update($this-&gt;input-&gt;post('album_id'),$album_data);
         url::redirect('Album');
   }
  
    public function delete($id)
   {
      $this-&gt;album_model-&gt;delete($id);
      url::redirect('Album');
   }
  
  private function get_genres_list()
  {
      $db_genres_list  = $this-&gt;genre_model-&gt;get_list(); 
      $genres_list  = array();
  
      if(sizeof($db_genres_list) &gt;= 1)
      {
          foreach($db_genres_list as $item)
          {
              $genres_list[$item-&gt;id] = $item-&gt;name;
          }
      }
      return $genres_list;
   }
  }
  </code></pre>
  
  <p>And I get this error when going to: <a href="http://localhost/kohana/" rel="nofollow">http://localhost/kohana/</a></p>
  
  <blockquote>
    <p>ErrorException [ Notice ]: Undefined property: Model_Album::$db</p>
    
    <p>APPPATH\classes\Model\Album.php [ 39 ]</p>
  </blockquote>
  
  <pre><code>public function get_list()
  {
  
  //error in the next line (39)
    $this-&gt;db-&gt;select('albums.id as id,albums.name as name,albums.author as author, genres.name as genre');  
  
    $this-&gt;db-&gt;from($this-&gt;album_table);  
    $this-&gt;db-&gt;join($this-&gt;genre_table,'genres.id','albums.genre_id');
    $query = $this-&gt;db-&gt;get();
    return $query-&gt;result_array();
  }
  </code></pre>
  
  <p>bootstrap:</p>
  
  <pre><code>&lt;?php defined('SYSPATH') or die('No direct script access.');
  
  // -- Environment setup     --------------------------------------------------------
  
  // Load the core Kohana class
  require SYSPATH.'classes/Kohana/Core'.EXT;
  
  if (is_file(APPPATH.'classes/Kohana'.EXT))
  {
      // Application extends the core
      require APPPATH.'classes/Kohana'.EXT;
  }
  else
  {
      // Load empty core extension
      require SYSPATH.'classes/Kohana'.EXT;
  }
  
  date_default_timezone_set('America/Lima');
  
  setlocale(LC_ALL, 'en_US.utf-8');
  
  spl_autoload_register(array('Kohana', 'auto_load'));
  
  
  //spl_autoload_register(array('Kohana', 'auto_load_lowercase'));
  
  /**
   * Enable the Kohana auto-loader for unserialization.
   *
   * @link http://www.php.net/manual/function.spl-autoload-call
   * @link http://www.php.net/manual/var.configuration#unserialize-callback-func
   */
  ini_set('unserialize_callback_func', 'spl_autoload_call');
  
  mb_substitute_character('none');
  
  // -- Configuration and initialization -----------------------------------------
  
  
  I18n::lang('en-us');
  
  if (isset($_SERVER['SERVER_PROTOCOL']))
  {
      // Replace the default protocol.
      HTTP::$protocol = $_SERVER['SERVER_PROTOCOL'];
  }
  
  
  if (isset($_SERVER['KOHANA_ENV']))
  {
      Kohana::$environment = constant('Kohana::'.strtoupper($_SERVER['KOHANA_ENV']));
  }
  
  Kohana::init(array(
      'base_url'   =&gt; '/kohana/',
  ));
  
  
  Kohana::$log-&gt;attach(new Log_File(APPPATH.'logs'));
  
  
  Kohana::$config-&gt;attach(new Config_File);
  
  
  Kohana::modules(array(
  // 'auth'       =&gt; MODPATH.'auth',       // Basic authentication
  // 'cache'      =&gt; MODPATH.'cache',      // Caching with multiple backends
  // 'codebench'  =&gt; MODPATH.'codebench',  // Benchmarking tool
  'database'   =&gt; MODPATH.'database',   // Database access
  // 'image'      =&gt; MODPATH.'image',      // Image manipulation
  // 'minion'     =&gt; MODPATH.'minion',     // CLI Tasks
  'orm'        =&gt; MODPATH.'orm',        // Object Relationship Mapping
  // 'unittest'   =&gt; MODPATH.'unittest',   // Unit testing
  // 'userguide'  =&gt; MODPATH.'userguide',  // User guide and API documentation
  ));
  
  
  // Cookie::$salt = NULL;
  
  Route::set('default', '(&lt;controller&gt;(/&lt;action&gt;(/&lt;id&gt;)))')
  -&gt;defaults(array(
      'controller' =&gt; 'Album',
      'action'     =&gt; 'index',
  ));
  </code></pre>
  
  <p>Model:</p>
  
  <pre><code>&lt;?php defined('SYSPATH') OR die('No direct access allowed.');
  
  class Model_Album extends Model_Database
  {
   private $album_table;
   private $genre_table; 
  
    public function __construct()
      {
      //parent::__construct();
      $this-&gt;album_table = 'albums';
      $this-&gt;genre_table = 'genres';
    }
  
    public function read($id)
    {
      $this-&gt;db-&gt;where('id', $id);
      $query = $this-&gt;db-&gt;get($this-&gt;album_table); 
        return $query-&gt;result_array();
   }
  
  public function delete($id)
    {
      $this-&gt;db-&gt;delete($this-&gt;album_table, array('id' =&gt; $id));
    }
  
    public function update($id,$data)
    {
      $this-&gt;db-&gt;update($this-&gt;album_table, $data, array('id' =&gt; $id));
    }
  
  public function create($data)
    {
         $this-&gt;db-&gt;insert($this-&gt;album_table, $data);
    }
  
  public function get_list()
   {
        $this-&gt;_db-&gt;select('albums.id as id,albums.name as name,albums.author as author, genres.name as genre');  
        $this-&gt;db-&gt;from($this-&gt;album_table);  
        $this-&gt;db-&gt;join($this-&gt;genre_table,'genres.id','albums.genre_id');
         $query = $this-&gt;db-&gt;get();
        return $query-&gt;result_array();
  }
  }
  </code></pre>
  
  <p>EDIT---</p>
  
  <p>database.php</p>
  
  <pre><code>&lt;?php defined('SYSPATH') OR die('No direct access allowed.');
  
  return array
  (
      'default2' =&gt; array
      (
          'type'       =&gt; 'MySQL',
          'connection' =&gt; array(
  
              'hostname'   =&gt; 'localhost',
              'database'   =&gt; 'cd_collection',
              'username'   =&gt; 'root',
              'password'   =&gt; 'root',
              'persistent' =&gt; FALSE,
          ),
          'table_prefix' =&gt; '',
          'charset'      =&gt; 'utf8',
          'caching'      =&gt; FALSE,
      ),
      'alternate' =&gt; array(
          'type'       =&gt; 'PDO',
          'connection' =&gt; array(
  
              'dsn'        =&gt; 'mysql:host=localhost;dbname=kohana',
              'username'   =&gt; 'root',
              'password'   =&gt; 'r00tdb',
              'persistent' =&gt; FALSE,
          ),
  
          'table_prefix' =&gt; '',
          'charset'      =&gt; 'utf8',
          'caching'      =&gt; FALSE,
      ),
  
      'default' =&gt; array
      (
          'type'       =&gt; 'MySQLi',
          'connection' =&gt; array(
              'hostname'   =&gt; 'localhost',
              'database'   =&gt; 'cd_collection',
              'username'   =&gt; 'root',
              'password'   =&gt; 'root',
              'persistent' =&gt; FALSE,
              'ssl'        =&gt; NULL,
          ),
          'table_prefix' =&gt; '',
          'charset'      =&gt; 'utf8',
          'caching'      =&gt; FALSE,
          'profiling'    =&gt; TRUE,
      ),
  );
  </code></pre>