是否可以覆蓋來自Model-> fetchAll()的值,以便它在全局範圍內工作。我曾嘗試在模型來覆蓋這一點,但不工作:覆蓋模型中的返回值
class Application_Model_DbTable_OdbcPush extends Zend_Db_Table_Abstract
{
public function __get(string $col)
{
$res = parent::__get($col);
if ($col == "lastrun") {
$res = ($res == "1912-12-12 00:00:00+07" ? NULL : $res);
}
return $res;
}
//...
}
在控制器:
$odbcModel = new Application_Model_DbTable_OdbcPush();
$rs = $odbcModel->fetchAll($select);
我要覆蓋從使用fetchall(返回值),發現()等在山坳名是「拉斯特魯恩」;
我不明白的問題。你想達到什麼目的? – RockyFord
我想覆蓋從fetchAll(),find()等返回的值,當col名稱是「lastrun」; – Superbiji