title: Return the model class in an OOP way
body: <p>I have a redundant method <code>q()</code> on all of my classes which inherit a certain parent class.</p>
  
  <p>The method <code>q()</code> always returns the model of the sub class. See code snippet:</p>
  
  <pre><code>class Record1 extends AR
  {
       public static function q()
       {
           return self::model(__CLASS__)
       }
  }
  
  class Record2 extends AR
  {
       public static function q()
       {
           return self::model(__CLASS__)
       }
  }
  </code></pre>
  
  <p>I'm planning to move the <code>q</code> method in the parent class AR. I'm thinking of using <code>get_called_class</code> but it does not detect the sub class when I'm trying to access it in the parent class.</p>
  
  <p>The 2 classes are AR classes for a MySQL database.</p>
  
  <p>To query tables I will be doing something like this:</p>
  
  <pre><code>$record1 = Record1::q()-&gt;findAll()
  </code></pre>
  
  <p>Any thoughts?</p>