src/ORM/Connect/PDOStatementHandle.php
public function typeCorrectedFetchAll()
    {
        if ($this->columnMeta === null) {
            $columnCount = $this->statement->columnCount();
            $this->columnMeta = [];
            for ($i = 0; $i<$columnCount; $i++) {
                $this->columnMeta[$i] = $this->statement->getColumnMeta($i);
            }
        }

        // Re-map fetched data using columnMeta
        return array_map(
            function ($rowArray) {
                $row = [];
                foreach ($this->columnMeta as $i => $meta) {
                    // Coerce any column types that aren't correctly retrieved from the database
                    if (isset($meta['native_type']) && isset(self::$type_mapping[$meta['native_type']])) {
                        settype($rowArray[$i], self::$type_mapping[$meta['native_type']]);
                    }
                    $row[$meta['name']] = $rowArray[$i];
                }
                return $row;
            },
            $this->statement->fetchAll(PDO::FETCH_NUM)
        );
    }
public function typeCorrectedFetchAll()
    {
        if ($this->columnMeta === null) {
            $columnCount = $this->statement->columnCount();
            $this->columnMeta = [];
            for ($i = 0; $i<$columnCount; $i++) {
                $this->columnMeta[$i] = $this->statement->getColumnMeta($i);
            }
        }

        // Re-map fetched data using columnMeta
        return array_map(
            function ($rowArray) {
                $row = [];
                foreach ($this->columnMeta as $i => $meta) {
                    // Coerce any column types that aren't correctly retrieved from the database
                    if (isset($meta['native_type']) && isset(self::$type_mapping[$meta['native_type']])) {
                        settype($rowArray[$i], self::$type_mapping[$meta['native_type']]);
                    }
                    $row[$meta['name']] = $rowArray[$i];
                }
                return $row;
            },
            $this->statement->fetchAll(PDO::FETCH_NUM)
        );
    }
public function typeCorrectedFetchAll ( ) { if ( $ this -> columnMeta === null ) { $ columnCount = $ this -> statement -> columnCount ( ) ; $ this -> columnMeta = [ ] ; for ( $ i = 0 ; $ i < $ columnCount ; $ i ++ ) { $ this -> columnMeta [ $ i ] = $ this -> statement -> getColumnMeta ( $ i ) ; } } // Re-map fetched data using columnMeta return array_map ( function ( $ rowArray ) { $ row = [ ] ; foreach ( $ this -> columnMeta as $ i => $ meta ) { // Coerce any column types that aren't correctly retrieved from the database if ( isset ( $ meta [ 'native_type' ] ) && isset ( self :: $ type_mapping [ $ meta [ 'native_type' ] ] ) ) { settype ( $ rowArray [ $ i ] , self :: $ type_mapping [ $ meta [ 'native_type' ] ] ) ; } $ row [ $ meta [ 'name' ] ] = $ rowArray [ $ i ] ; } return $ row ; } , $ this -> statement -> fetchAll ( PDO :: FETCH_NUM ) ) ; }
Fetch a record form the statement with its type data corrected
Returns data as an array of maps
@return array
Fetch a record form the statement with its type data corrected Returns data as an array of maps