protected function convertRow(array $row, Connection $connection, Table $table)
    {
        $result = [];
        foreach ($row as $key => $value) {
            $type = $table->getColumn($key)->getType();
            $val  = $type->convertToPHPValue($value, $connection->getDatabasePlatform());

            if ($type instanceof Types\DateTimeType) {
                $val = $val->format(\DateTime::RFC3339);
            } elseif ($type instanceof Types\DateTimeTzType) {
                $val = $val->format(\DateTime::RFC3339_EXTENDED);
            } elseif ($type instanceof Types\TimeType) {
                $val = $val->format('H:i:s');
            } elseif ($type instanceof Types\BinaryType || $type instanceof Types\BlobType) {
                $val = base64_encode(stream_get_contents($val));
            }

            $result[$key] = $val;
        }

        return $result;
    }
protected function convertRow(array $row, Connection $connection, Table $table)
    {
        $result = [];
        foreach ($row as $key => $value) {
            $type = $table->getColumn($key)->getType();
            $val  = $type->convertToPHPValue($value, $connection->getDatabasePlatform());

            if ($type instanceof Types\DateTimeType) {
                $val = $val->format(\DateTime::RFC3339);
            } elseif ($type instanceof Types\DateTimeTzType) {
                $val = $val->format(\DateTime::RFC3339_EXTENDED);
            } elseif ($type instanceof Types\TimeType) {
                $val = $val->format('H:i:s');
            } elseif ($type instanceof Types\BinaryType || $type instanceof Types\BlobType) {
                $val = base64_encode(stream_get_contents($val));
            }

            $result[$key] = $val;
        }

        return $result;
    }
protected function convertRow ( array $ row , Connection $ connection , Table $ table ) { $ result = [ ] ; foreach ( $ row as $ key => $ value ) { $ type = $ table -> getColumn ( $ key ) -> getType ( ) ; $ val = $ type -> convertToPHPValue ( $ value , $ connection -> getDatabasePlatform ( ) ) ; if ( $ type instanceof Types \ DateTimeType ) { $ val = $ val -> format ( \ DateTime :: RFC3339 ) ; } elseif ( $ type instanceof Types \ DateTimeTzType ) { $ val = $ val -> format ( \ DateTime :: RFC3339_EXTENDED ) ; } elseif ( $ type instanceof Types \ TimeType ) { $ val = $ val -> format ( 'H:i:s' ) ; } elseif ( $ type instanceof Types \ BinaryType || $ type instanceof Types \ BlobType ) { $ val = base64_encode ( stream_get_contents ( $ val ) ) ; } $ result [ $ key ] = $ val ; } return $ result ; }
Converts a raw database row to the correct PHP types

@param array $row
@param \Doctrine\DBAL\Connection $connection
@param \Doctrine\DBAL\Schema\Table $table
@return array
@throws \Doctrine\DBAL\Schema\SchemaException
Converts a raw database row to the correct PHP types