3 * Overloads the relevant methods of the real ResultsWrapper so it
4 * doesn't go anywhere near an actual database.
6 class FakeResultWrapper
extends ResultWrapper
{
7 /** @var $result stdClass[] */
10 * @param stdClass[] $rows
12 function __construct( array $rows ) {
13 parent
::__construct( null, $rows );
17 return count( $this->result
);
21 if ( $this->pos
< count( $this->result
) ) {
22 $this->currentRow
= $this->result
[$this->pos
];
24 $this->currentRow
= false;
27 if ( is_object( $this->currentRow
) ) {
28 return get_object_vars( $this->currentRow
);
30 return $this->currentRow
;
34 function seek( $row ) {
41 function fetchObject() {
43 if ( $this->currentRow
) {
44 return (object)$this->currentRow
;
52 $this->currentRow
= null;
56 return $this->fetchObject();