【发布时间】:2012-04-09 13:38:34
【问题描述】:
我正在 cakephp 中开发一个应用程序。我需要使用 cakephp 中的 updateAll() 函数获取所有已更新行的 ID。任何建议将不胜感激。谢谢。。
这是我应该在我的应用模型中做的事情
class AppModel extends Model {
var $infos = array();
function updateAll($fields, $conditions = true) {
$this->$infos = $this->find('all', array('conditions' => $conditions));
$return = parent::updateAll($fields, $conditions);
$this->afterUpdateAll();
return $return;
}
function afterUpdateAll(){
foreach ($this->$infos as $info) {
//do something
}
}
}
这行得通吗..?
【问题讨论】:
标签: php mysql cakephp cakephp-1.3 cakephp-model