convertToNativeTypes() public static méthode

Converts columns from strings to types according to PDOStatement::columnMeta http://stackoverflow.com/a/9952703/3006989
public static convertToNativeTypes ( PDOStatement $statement, $rows ) : copy
$statement PDOStatement
Résultat copy of $assoc with matching type fields
Exemple #1
0
 /** Fetch all row
  *
  * @param string $index      specify index column
  * @param string $selectOnly select columns which could be fetched
  *
  * @return array of fetched rows
  */
 public function fetchAll($index = '', $selectOnly = '')
 {
     if ($selectOnly) {
         $this->select(null)->select($index . ', ' . $selectOnly);
     }
     if ($index) {
         $data = array();
         foreach ($this as $row) {
             if (is_object($row)) {
                 $data[$row->{$index}] = $row;
             } else {
                 $data[$row[$index]] = $row;
             }
         }
         return $data;
     } else {
         if (($s = $this->execute()) !== false) {
             if ($this->convertTypes) {
                 return FluentUtils::convertToNativeTypes($s, $s->fetchAll());
             } else {
                 return $s->fetchAll();
             }
         }
         return $s;
     }
 }