MediaWiki  master
Wikimedia\Rdbms\MysqliResultWrapper Class Reference
Inheritance diagram for Wikimedia\Rdbms\MysqliResultWrapper:
Collaboration diagram for Wikimedia\Rdbms\MysqliResultWrapper:

Public Member Functions

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

Protected Member Functions

 doFetchObject ()
 Get the next row as a stdClass object, or false if iteration has proceeded past the end. More...
 
 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. More...
 
 doFree ()
 Free underlying data. More...
 
 doGetFieldNames ()
 Get the field names in the result set. More...
 
 doNumRows ()
 Get the number of rows in the result set. More...
 
 doSeek ( $pos)
 Modify the current cursor position to the row with the specified offset. More...
 

Private Member Functions

 checkFetchError ()
 

Private Attributes

DatabaseMysqli $db
 
mysqli_result null $result
 

Additional Inherited Members

- Static Public Member Functions inherited from Wikimedia\Rdbms\ResultWrapper
static unwrap ( $res)
 Get the underlying RDBMS driver-specific result resource. More...
 
- 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(). More...
 
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. More...
 
int $nextPos = 0
 The offset of the row that would be returned by the next call to fetchObject(). More...
 

Detailed Description

Definition at line 7 of file MysqliResultWrapper.php.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\Rdbms\MysqliResultWrapper::__construct ( DatabaseMysqli  $db,
mysqli_result  $result 
)
Access: internal
Parameters
DatabaseMysqli$db
mysqli_result$result

Definition at line 19 of file MysqliResultWrapper.php.

References Wikimedia\Rdbms\MysqliResultWrapper\$db, and Wikimedia\Rdbms\MysqliResultWrapper\$result.

Member Function Documentation

◆ checkFetchError()

Wikimedia\Rdbms\MysqliResultWrapper::checkFetchError ( )
private

◆ doFetchObject()

Wikimedia\Rdbms\MysqliResultWrapper::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 46 of file MysqliResultWrapper.php.

References Wikimedia\Rdbms\MysqliResultWrapper\checkFetchError().

◆ doFetchRow()

Wikimedia\Rdbms\MysqliResultWrapper::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 55 of file MysqliResultWrapper.php.

References Wikimedia\Rdbms\MysqliResultWrapper\checkFetchError().

◆ doFree()

Wikimedia\Rdbms\MysqliResultWrapper::doFree ( )
protected

Free underlying data.

It is not necessary to do anything.

Reimplemented from Wikimedia\Rdbms\ResultWrapper.

Definition at line 79 of file MysqliResultWrapper.php.

◆ doGetFieldNames()

Wikimedia\Rdbms\MysqliResultWrapper::doGetFieldNames ( )
protected

Get the field names in the result set.

Returns
string[]

Reimplemented from Wikimedia\Rdbms\ResultWrapper.

Definition at line 83 of file MysqliResultWrapper.php.

◆ doNumRows()

Wikimedia\Rdbms\MysqliResultWrapper::doNumRows ( )
protected

Get the number of rows in the result set.

Since
1.37
Returns
int

Reimplemented from Wikimedia\Rdbms\ResultWrapper.

Definition at line 24 of file MysqliResultWrapper.php.

◆ doSeek()

Wikimedia\Rdbms\MysqliResultWrapper::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 64 of file MysqliResultWrapper.php.

◆ getInternalFieldInfo()

Wikimedia\Rdbms\MysqliResultWrapper::getInternalFieldInfo (   $fieldName)

Get information about a field in the result set.

Parameters
string$fieldName
Returns
bool|MySQLField
Access: internal
For DatabaseMysqlBase::fieldInfo() only

Definition at line 99 of file MysqliResultWrapper.php.

◆ getInternalResult()

Wikimedia\Rdbms\MysqliResultWrapper::getInternalResult ( )

Get the underlying result object or array.

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

Definition at line 75 of file MysqliResultWrapper.php.

References Wikimedia\Rdbms\MysqliResultWrapper\$result.

Member Data Documentation

◆ $db

DatabaseMysqli Wikimedia\Rdbms\MysqliResultWrapper::$db
private

◆ $result

mysqli_result null Wikimedia\Rdbms\MysqliResultWrapper::$result
private

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