Declaration of UtilityBehavior::beforeDelete() should be compatible with ModelBehavior::beforeDelete(Model $model, $cascade = true)
当我加载一个控制器时出现此错误,但它不存在于任何其他控制器中。
这是 Term 控制器中唯一的删除操作
public function admin_delete($id = null) {
if (!$this->request->is('post')) {
throw new MethodNotAllowedException();
}
$this->Term->id = $id;
if (!$this->Term->exists()) {
throw new NotFoundException(__('Invalid term'));
}
if ($this->Term->delete()) {
$this->Session->setFlash(__('Term deleted'));
$this->redirect(array('action' => 'index'));
}
$this->Session->setFlash(__('term was not deleted'));
$this->redirect(array('action' => 'index'));
}
控制器是术语控制器