/** * {@inheritdoc} */ public function read() { if ($this->executed) { return null; } $this->executed = true; $data = array(); while ($row = parent::read()) { $data[] = $row; } return $data; }
/** * CSVの現在行を配列として読み込む * @return array|boolean 読み出したCSVの配列、または読み込むデータがない場合はFALSEを返す * @access public */ public function read() { // 行を取得 if (($arr = parent::read()) === false) { return false; } // フォーマットに合わせて成形 $csv = array(); foreach ($this->format as $key => $params) { $csv[$key] = $this->filter(rtrim($arr[$this->col]), $params); $this->col++; } $this->col = 0; return $csv; }