注册于:7年前 ,最后活跃于:1年前
Ta 的动态:
使用 get_class 显示类名为 dao
然后在 dao 类下 能查到 fetchAll 方法,代码如下
/**
* 获取所有记录。
* Fetch all records.
*
* @param string $keyField 返回以该字段做键的记录
* the key field, thus the return records is keyed by this field
* @access public
* @return array the records
*/
public function fetchAll($keyField = '')
{
$stmt = $this->query();
if(empty($keyField)) return $stmt->fetchAll();
$rows = array();
while($row = $stmt->fetch()) $rows[$row->$keyField] = $row;
return $rows;
}