/** * 转换为一个数组 * * @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; }
/** * @return mixed */ public function current() { return $this->result->current(); }