title: CakePHP Fatal Error: Call to undefined method stdClass::findById()
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/11925523/cakephp-datasource-call-to-undefined-method">cakephp datasource Call to undefined method</a>  </p>
  </blockquote>
  
  
  
  <p>I'm getting this kind of error</p>
  
  <pre><code>Fatal error: Call to undefined method stdClass::findById() in C:\wamp\www\studiohelper\app\controllers\recurring_invoices_controller.php on line 309
  </code></pre>
  
  <p>Here is the code on that line:</p>
  
  <pre><code>$invoice = $this-&gt;Invoice-&gt;findById($invoiceId);
  </code></pre>
  
  <p>It looks like a pretty basic code but why on earth do I get that kind of error?</p>