MediaWiki  1.23.14
ResultWrapper Class Reference

Result wrapper for grabbing data queried by someone else. More...

Inheritance diagram for ResultWrapper:
Collaboration diagram for ResultWrapper:

Public Member Functions

 __construct ( $database, $result)
 Create a new result object from a result resource and a Database 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...
 
 key ()
 
 next ()
 
 numRows ()
 Get the number of rows in a result object. More...
 
 rewind ()
 
 seek ( $row)
 Change the position of the cursor in a result object. More...
 
 valid ()
 

Public Attributes

resource $result
 

Protected Attributes

 $currentRow = null
 
DatabaseBase $db
 
int $pos = 0
 

Detailed Description

Result wrapper for grabbing data queried by someone else.

Definition at line 99 of file DatabaseUtility.php.

Constructor & Destructor Documentation

◆ __construct()

ResultWrapper::__construct (   $database,
  $result 
)

Create a new result object from a result resource and a Database object.

Parameters
DatabaseBase$database
resource | ResultWrapper$result

Definition at line 115 of file DatabaseUtility.php.

References $result.

Member Function Documentation

◆ current()

ResultWrapper::current ( )
Returns
int

Definition at line 192 of file DatabaseUtility.php.

◆ fetchObject()

ResultWrapper::fetchObject ( )

Fetch the next row from the given result object, in object form.

Fields can be retrieved with $row->fieldname, with fields acting like member variables.

Returns
object
Exceptions
DBUnexpectedErrorThrown if the database returns an error

Reimplemented in MssqlResultWrapper, and FakeResultWrapper.

Definition at line 142 of file DatabaseUtility.php.

◆ fetchRow()

ResultWrapper::fetchRow ( )

Fetch the next row from the given result object, in associative array form.

Fields are retrieved with $row['fieldname'].

Returns
array
Exceptions
DBUnexpectedErrorThrown if the database returns an error

Reimplemented in MssqlResultWrapper, and FakeResultWrapper.

Definition at line 153 of file DatabaseUtility.php.

◆ free()

ResultWrapper::free ( )

Free a result object.

Reimplemented in FakeResultWrapper.

Definition at line 160 of file DatabaseUtility.php.

◆ key()

ResultWrapper::key ( )
Returns
int

Definition at line 203 of file DatabaseUtility.php.

◆ next()

ResultWrapper::next ( )
Returns
int

Reimplemented in FakeResultWrapper.

Definition at line 210 of file DatabaseUtility.php.

◆ numRows()

ResultWrapper::numRows ( )

Get the number of rows in a result object.

Returns
int

Reimplemented in FakeResultWrapper.

Definition at line 130 of file DatabaseUtility.php.

Referenced by rewind().

◆ rewind()

ResultWrapper::rewind ( )

Reimplemented in FakeResultWrapper.

Definition at line 181 of file DatabaseUtility.php.

References numRows().

◆ seek()

ResultWrapper::seek (   $row)

Change the position of the cursor in a result object.

See mysql_data_seek()

Parameters
int$row

Reimplemented in MssqlResultWrapper, and FakeResultWrapper.

Definition at line 172 of file DatabaseUtility.php.

◆ valid()

ResultWrapper::valid ( )
Returns
bool

Definition at line 220 of file DatabaseUtility.php.

Member Data Documentation

◆ $currentRow

ResultWrapper::$currentRow = null
protected

Definition at line 107 of file DatabaseUtility.php.

◆ $db

DatabaseBase ResultWrapper::$db
protected

Definition at line 102 of file DatabaseUtility.php.

◆ $pos

int ResultWrapper::$pos = 0
protected

Definition at line 104 of file DatabaseUtility.php.

◆ $result

resource ResultWrapper::$result

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