title: More than 1 object type per table
body: <p>I have developed a scheduling application where I have one table and dm class called "users" where i so far have stored all information about all users in the system. All users are internal users. </p>
  
  <p>Now I need to implement login functionality for external users (customers) too. </p>
  
  <p>My question:
  I would now like to use my table users and just add an enum field 'user_type' (internal/external). </p>
  
  <p>I would then like to create a datamapper object called internal_user and another one called exernal_user.</p>
  
  <p>when i run </p>
  
  <pre><code>$external_user = new External_user();
  $external_user-&gt;get();
  </code></pre>
  
  <p>I only want to get the rows in my user table where user_type = external. Is that possible to achieve in a nice way using datamapper?</p>
  
  <p>UPDATE:</p>
  
  <p>I solved the problem by overriding the get method in the Datamapper class like this:</p>
  
  <pre><code>class Internal_user(){
      [...]
      function get()
      {
          $this-&gt;where('type', 'internal');
          return parent::get();
      }
  }
  </code></pre>
  
  <p>Now this line:</p>
  
  <pre><code>$internal_user-&gt;get();
  </code></pre>
  
  <p>only returns the records with the value internal in my user_type field.</p>