Back | Home
الـ Path الحالي: /home/picotech/domains/instantly.picotech.app/public_html/vendor/theseer/../egulias/.././unicodeveloper/.././nunomaduro/../mews/../maennchen/../theseer/../monolog/../phpoffice/../maennchen/../ramsey/../theseer/../egulias/./../voku/../tijsverkoyen/../egulias/../doctrine/./dbal/src/Driver
الملفات الموجودة في هذا الـ Path:
.
..
API
AbstractDB2Driver.php
AbstractException.php
AbstractMySQLDriver.php
AbstractOracleDriver
AbstractOracleDriver.php
AbstractPostgreSQLDriver.php
AbstractSQLServerDriver
AbstractSQLServerDriver.php
AbstractSQLiteDriver
AbstractSQLiteDriver.php
Connection.php
Exception
Exception.php
FetchUtils.php
IBMDB2
Middleware
Middleware.php
Mysqli
OCI8
PDO
PgSQL
Result.php
SQLSrv
SQLite3
ServerInfoAwareConnection.php
Statement.php

مشاهدة ملف: FetchUtils.php

<?php

declare(strict_types=1);

namespace Doctrine\DBAL\Driver;

/** @internal */
final class FetchUtils
{
    /**
     * @return mixed|false
     *
     * @throws Exception
     */
    public static function fetchOne(Result $result)
    {
        $row = $result->fetchNumeric();

        if ($row === false) {
            return false;
        }

        return $row[0];
    }

    /**
     * @return list<list<mixed>>
     *
     * @throws Exception
     */
    public static function fetchAllNumeric(Result $result): array
    {
        $rows = [];

        while (($row = $result->fetchNumeric()) !== false) {
            $rows[] = $row;
        }

        return $rows;
    }

    /**
     * @return list<array<string,mixed>>
     *
     * @throws Exception
     */
    public static function fetchAllAssociative(Result $result): array
    {
        $rows = [];

        while (($row = $result->fetchAssociative()) !== false) {
            $rows[] = $row;
        }

        return $rows;
    }

    /**
     * @return list<mixed>
     *
     * @throws Exception
     */
    public static function fetchFirstColumn(Result $result): array
    {
        $rows = [];

        while (($row = $result->fetchOne()) !== false) {
            $rows[] = $row;
        }

        return $rows;
    }
}