我有一个自定义数据源,我们称之为SQSDatasource
。它工作正常,一般来说,对于find()
,save()
,甚至delete()
。
class SQSDatasource extends DataSource {
public function delete(Model $Model, $conditions = null) {
// Deliberate break point to ensure that this function is being called
print_r($conditions);
exit();
// I have my proper delete logic here, which works fine usually
}
}
一个模型,说它Job
使用SQSDatasource
. 中没有特别的逻辑Job
。
然而,我遇到了一个奇怪的异常。
class TestShell extends AppShell {
public $uses = array('Job');
public function main() {
// This works fine.
$job = $this->Job->find('first');
// The break point never gets called
$this->Job->delete('TEST!');
// This gets called
$this->out('This gets called.');
}
}
$this->Job->find()
但是,如果我在调用之前删除$this->Job->delete()
,它工作得很好。delete()
会被调用。
有人对这个异常有任何线索吗?