예제 #1
0
 /**
  * Converts $this->data into an array.
  */
 protected function dataToArray()
 {
     if (is_array($this->data)) {
         return;
     }
     if ($this->data === null) {
         $db = Connection::instance($this->dbLink);
         $this->data = $db->fetchAll($this->sql);
         return;
     }
     if ($this->data instanceof PDOStatement) {
         $this->data = $this->data->fetchAll();
         return;
     }
     if ($this->data === false) {
         throw new InfoException('Unable to "fetchAll()", the query failed', (string) $this->sql);
     }
     return parent::dataToArray();
 }