Uname: Linux webm012.cluster130.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
Software: Apache
PHP version: 8.0.30 [ PHP INFO ] PHP os: Linux
Server Ip: 145.239.37.162
Your Ip: 216.73.216.190
User: dreampi (1009562) | Group: users (100)
Safe Mode: OFF
Disable Function:
_dyuweyrj4,_dyuweyrj4r,dl

name : Result.php
<?php declare(strict_types = 1);

namespace MailPoet\Doctrine\WPDB;

if (!defined('ABSPATH')) exit;


use MailPoetVendor\Doctrine\DBAL\Driver\Result as ResultInterface;

/**
 * WPDB fetches all results from the underlying database driver,
 * so we need to implement the result methods on in-memory data.
 */
class Result implements ResultInterface {
  /** @var array[] */
  private array $result = [];
  private int $rowCount;
  private int $cursor = 0;

  public function __construct(
    array $result,
    int $rowCount
  ) {
    foreach ($result as $row) {
      $this->result[] = (array)$row;
    }
    $this->rowCount = $rowCount;
  }

  public function fetchNumeric() {
    $row = $this->result[$this->cursor++] ?? null;
    return $row === null ? false : array_values($row);
  }

  public function fetchAssociative() {
    return $this->result[$this->cursor++] ?? false;
  }

  public function fetchOne() {
    $row = $this->result[$this->cursor++] ?? null;
    return $row === null ? false : reset($row);
  }

  public function fetchAllNumeric(): array {
    $result = [];
    foreach ($this->result as $row) {
      $result[] = array_values($row);
    }
    return $result;
  }

  public function fetchAllAssociative(): array {
    return $this->result;
  }

  public function fetchFirstColumn(): array {
    $result = [];
    foreach ($this->result as $row) {
      $result[] = reset($row);
    }
    return $result;
  }

  public function rowCount(): int {
    return $this->rowCount;
  }

  public function columnCount(): int {
    return count($this->result[0] ?? []);
  }

  public function free(): void {
    $this->cursor = 0;
  }
}
© 2026 GrazzMean-Shell