title: Get the model name to implement a reusable method in AppModel in CakePHP
body: <p>How can I get the current model name in <code>AppModel</code>?</p>
  
  <p>I have this code to verify password and confirm password. But I would like to put it in <code>AppModelp</code>:</p>
  
  <pre><code>function isSameAs($check, $field) {
    if( $check === $this-&gt;data['User'][$field] ) {
      return true;
    }
    else {
      return false;
    }
  }
  </code></pre>
  
  <p>I am using CakePHP 2.</p>