Perhaps you meant DboSource
instead of DataSource
.
DataSource has no method query, DboSource does. Update your code to look like:
App::uses('DboSource', 'Model/Datasource');
class FeedSource extends DboSource {}
Edit: Looks like that is not the issue. In the Model
there is a magic __call method which calls
$this->getDataSource()->query($method, $params, $this);
Source You need to implement this yourself.
class FeedSource extends DataSource {
public function abcd() {
echo 'Hello World!';
}
public function query($method, $params, $Model) {
// you may customize this to your needs.
if (method_exists($this, $method)) {
return call_user_func_array(array($this, $method), $params);
}
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…