3 namespace Wikimedia\Rdbms
;
8 * Overloads the relevant methods of the real ResultsWrapper so it
9 * doesn't go anywhere near an actual database.
11 class FakeResultWrapper
extends ResultWrapper
{
12 /** @var stdClass[]|array[] $result */
15 * @param stdClass[]|array[] $rows
17 function __construct( array $rows ) {
18 parent
::__construct( null, $rows );
22 return count( $this->result
);
25 function fetchObject() {
26 $current = $this->current();
34 $row = $this->valid() ?
$this->result
[$this->pos
] : false;
38 return is_object( $row ) ?
get_object_vars( $row ) : $row;
41 function seek( $pos ) {
54 $row = $this->valid() ?
$this->result
[$this->pos
] : false;
56 return is_array( $row ) ?
(object)$row : $row;
66 return $this->current();
70 return array_key_exists( $this->pos
, $this->result
);
75 * @deprecated since 1.29
77 class_alias( FakeResultWrapper
::class, 'FakeResultWrapper' );