title: Implementing class inheritance in codeigniter
body: <p>I am confused, again, about implementing OOP in CodeIgniter.</p>
  
  <p>By design, I have two classes, namely Customer and Supplier. Both classes extends a super class I call Institution.</p>
  
  <p>It was not a problem for me when I wrote them using only php (without framework).</p>
  
  <pre><code>class Customer extends Institution {
      public function __construct() {
          parent::__construct();
      }
  }
  
  class Supplier extends Institution {
      public function __construct() {
          parent::__construct();
      }
  }
  
  class Institution extends DBConnection {
      public function __construct() {
          parent::__construct();
      }
  }
  
  class DBConnection {
      // do CRUD activities here
  }
  </code></pre>
  
  <p>The questions are:</p>
  
  <ol>
  <li>How do I write them using CI? </li>
  <li>Is it as Controller or in Model the best way to implement them? What factors should be considered?</li>
  </ol>
  
  <p>A friend suggested a way I thought a bit hacky, model extends model. I try, if possible, to do it in codeigniter-appropriate way. </p>
  
  <p>Any suggestion will be appreciated.</p>