/** * 转换为一个数组 * * @param Result $result * @return array */ public function toArray(Result $result) { $data = array(); if ($result->valid()) { if (!$result->current()) { return $data; } } while ($result->valid()) { $data[] = $result->current(); $result->next(); } return $data; }
public function next() { $this->result->next(); }