MediaWiki REL1_37
Wikimedia\Rdbms\SqliteResultWrapper Class Reference
Inheritance diagram for Wikimedia\Rdbms\SqliteResultWrapper:
Collaboration diagram for Wikimedia\Rdbms\SqliteResultWrapper:

Public Member Functions

 __construct (PDOStatement $result)
 
 getInternalResult ()
 Get the underlying result object or array.
 
- Public Member Functions inherited from Wikimedia\Rdbms\ResultWrapper
 count ()
 Get the number of rows in a result object.
 
 current ()
 
 fetchObject ()
 Fetch the next row from the given result object, in object form.
 
 fetchRow ()
 Fetch the next row from the given result object, in associative array form.
 
 free ()
 Free a result object.
 
 getFieldNames ()
 Get the names of the fields in the result.
 
 key ()
 
 next ()
 
 numRows ()
 Get the number of rows in a result object.
 
 rewind ()
 
 seek ( $pos)
 Change the position of the cursor in a result object.
 
 valid ()
 

Protected Member Functions

 doFetchObject ()
 Get the next row as a stdClass object, or false if iteration has proceeded past the end.
 
 doFetchRow ()
 Get the next row as an array containing the data duplicated, once with string keys and once with numeric keys, per the PDO::FETCH_BOTH convention.
 
 doFree ()
 Free underlying data.
 
 doGetFieldNames ()
 Get the field names in the result set.
 
 doNumRows ()
 Get the number of rows in the result set.
 
 doSeek ( $pos)
 Modify the current cursor position to the row with the specified offset.
 

Private Attributes

PDOStatement $result
 
ArrayIterator $rows
 

Additional Inherited Members

- Static Public Member Functions inherited from Wikimedia\Rdbms\ResultWrapper
static unwrap ( $res)
 Get the underlying RDBMS driver-specific result resource.
 
- Protected Attributes inherited from Wikimedia\Rdbms\ResultWrapper
int $currentPos = 0
 The offset of the current row that would be returned by current() and may have been previously returned by fetchObject().
 
stdClass array bool null $currentRow
 The row at $this->currentPos, or null if it has not yet been retrieved, or false if the current row was past the end.
 
int $nextPos = 0
 The offset of the row that would be returned by the next call to fetchObject().
 

Detailed Description

Definition at line 9 of file SqliteResultWrapper.php.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\Rdbms\SqliteResultWrapper::__construct ( PDOStatement  $result)
Access: internal
Parameters
PDOStatement$result

Definition at line 19 of file SqliteResultWrapper.php.

References Wikimedia\Rdbms\SqliteResultWrapper\$result.

Member Function Documentation

◆ doFetchObject()

Wikimedia\Rdbms\SqliteResultWrapper::doFetchObject ( )
protected

Get the next row as a stdClass object, or false if iteration has proceeded past the end.

The offset within the result set is in $this->currentPos.

Since
1.37
Returns
stdClass|bool

Reimplemented from Wikimedia\Rdbms\ResultWrapper.

Definition at line 42 of file SqliteResultWrapper.php.

References Wikimedia\Rdbms\ResultWrapper\$currentPos.

Referenced by Wikimedia\Rdbms\SqliteResultWrapper\doFetchRow().

◆ doFetchRow()

Wikimedia\Rdbms\SqliteResultWrapper::doFetchRow ( )
protected

Get the next row as an array containing the data duplicated, once with string keys and once with numeric keys, per the PDO::FETCH_BOTH convention.

Or false if iteration has proceeded past the end.

Returns
array|bool

Reimplemented from Wikimedia\Rdbms\ResultWrapper.

Definition at line 46 of file SqliteResultWrapper.php.

References Wikimedia\Rdbms\SqliteResultWrapper\doFetchObject().

◆ doFree()

Wikimedia\Rdbms\SqliteResultWrapper::doFree ( )
protected

Free underlying data.

It is not necessary to do anything.

Reimplemented from Wikimedia\Rdbms\ResultWrapper.

Definition at line 64 of file SqliteResultWrapper.php.

◆ doGetFieldNames()

Wikimedia\Rdbms\SqliteResultWrapper::doGetFieldNames ( )
protected

Get the field names in the result set.

Returns
string[]

Reimplemented from Wikimedia\Rdbms\ResultWrapper.

Definition at line 69 of file SqliteResultWrapper.php.

◆ doNumRows()

Wikimedia\Rdbms\SqliteResultWrapper::doNumRows ( )
protected

Get the number of rows in the result set.

Since
1.37
Returns
int

Reimplemented from Wikimedia\Rdbms\ResultWrapper.

Definition at line 38 of file SqliteResultWrapper.php.

References Wikimedia\Rdbms\ResultWrapper\count().

◆ doSeek()

Wikimedia\Rdbms\SqliteResultWrapper::doSeek (   $pos)
protected

Modify the current cursor position to the row with the specified offset.

If $pos is out of bounds, the behaviour is undefined.

Parameters
int$pos

Reimplemented from Wikimedia\Rdbms\ResultWrapper.

Definition at line 60 of file SqliteResultWrapper.php.

◆ getInternalResult()

Wikimedia\Rdbms\SqliteResultWrapper::getInternalResult ( )

Get the underlying result object or array.

Since
1.37
Deprecated:
since 1.37 Only exists to support deprecated methods
Returns
PDOStatement

Definition at line 34 of file SqliteResultWrapper.php.

References Wikimedia\Rdbms\SqliteResultWrapper\$result.

Member Data Documentation

◆ $result

PDOStatement Wikimedia\Rdbms\SqliteResultWrapper::$result
private

◆ $rows

ArrayIterator Wikimedia\Rdbms\SqliteResultWrapper::$rows
private

Definition at line 13 of file SqliteResultWrapper.php.


The documentation for this class was generated from the following file: