cakephp / datasources

CakePHP Datasources
http://cakephp.org
237 stars 114 forks source link

Fatal error: Call to undefined method ArraySource::query() #88

Closed ghost closed 10 years ago

ghost commented 11 years ago

Created by Pawan Mittal, 14th Aug 2013. (originally Lighthouse ticket #54):


I am getting this error when trying to use Array datasource with cakephp:

Fatal error: Call to undefined method ArraySource::query() in /Applications/MAMP/htdocs/cakephp-2.3.9/lib/Cake/Model/Model.php on line 799

My datasource plugin is at: app/Plugin/datasources and I have grabbed the branch 2.3 from https://github.com/cakephp/datasources/

In app/Config/bootstrap.php I am loading all pluigins:

CakePlugin::loadAll();

And app/Config/database.php looks like this:

public $default = array( 'datasource' => 'Datasources.ArraySource' );

AD7six commented 10 years ago

That effectively means you called a method on your model that doesn't exist. The array datasources doesn't implement query - which is also the method called when you do $ModelInstance->foo().