title: Cakephp REST Api print last query
body: <p>I am getting below error whenever try to print last query in my REST api controller.</p>
  
  <blockquote>
    <p>Error: Call to undefined method ApiController::getDatasource() File:
    /var/www/html/app/Controller/ApiController.php Line: 734</p>
  </blockquote>
  
  <p>Here is code</p>
  
  <pre><code>    $result = $this-&gt;Article-&gt;find('all', array(
          'conditions' =&gt; array('Article.active' =&gt; 1),
          'limit' =&gt; $limit, 'offset' =&gt; $start,
          'updated' =&gt; 'desc'
      ));
  
      $dbo = $this-&gt;getDatasource();
      $logs = $dbo-&gt;getLog();
      pr($result); die;
  </code></pre>
  
  <p>Query is working fine. 
  I created this rest controller by <a href="http://miftyisbored.com/complete-restful-service-client-cakephp-tutorial/" rel="nofollow">tutorial</a>. Let me know if you need more.</p>