title: CakePHP 1.3 paginate with custom query
body: <p>I've managed to over-ride the default methods for a custom query in my model as suggested elsewhere,</p>
  
  <pre><code>function paginate($conditions, $fields, $order, $limit, $page = 1, $recursive = null, $extra = array())
  </code></pre>
  
  <p>and</p>
  
  <pre><code>function paginateCount($conditions = null, $recursive = 0, $extra = array())
  </code></pre>
  
  <p>Unfortunately this approach over-rides <strong>all</strong> pagination for this model, and affects other pagination elsewhere. I found some code which may help where I could select whether I wanted the custom pagination used based on a variable e.g.</p>
  
  <p>In my model</p>
  
  <pre><code>var $useCustom = false;
  
  function paginateCount($conditions = null, $recursive = 0, $extra = array())
  {
  if(!$this-&gt;useCustom)
      return parent::paginateCount($conditions, $recursive);
  
  // code to handle custom paginate count here
  }
  </code></pre>
  
  <p>I have found that using this method gives me an error, </p>
  
  <blockquote>
    <p>Fatal error: Call to undefined method
    AppModel::paginateCount() in....</p>
  </blockquote>
  
  <p>What am I doing wrong? I assume that I would also need similar code in the paginate function as well? Am I also correct in thinking that I can set this variable in my controller i.e. <code>$this-&gt;useCustom = 'true';</code></p>