Page MenuHomeDevCentral

MySQLiDatabaseResult.php
No OneTemporary

MySQLiDatabaseResult.php

<?php
namespace Keruald\Database\Result;
use mysqli_result;
use Traversable;
class MySQLiDatabaseResult extends DatabaseResult {
///
/// Constructor
///
public function __construct (
private mysqli_result $result,
private int $resultType = MYSQLI_ASSOC
) { }
///
/// DatabaseResult implementation
///
public function numRows () : int {
return $this->result->num_rows;
}
public function fetchRow () : ?array {
return $this->result->fetch_array($this->resultType);
}
///
/// IteratorAggregate implementation
///
public function getIterator () : Traversable {
while ($row = $this->fetchRow()) {
yield $row;
}
}
}

File Metadata

Mime Type
text/x-php
Expires
Mon, Nov 17, 15:44 (9 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3131758
Default Alt Text
MySQLiDatabaseResult.php (749 B)

Event Timeline