MediaWiki  REL1_24
ResultWrapper Class Reference

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

Inheritance diagram for ResultWrapper:
Collaboration diagram for ResultWrapper:

List of all members.

Public Member Functions

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

Public Attributes

resource $result
 *

Protected Attributes

object null $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

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 114 of file DatabaseUtility.php.


Member Function Documentation

Returns:
stdClass|array|bool

Definition at line 192 of file DatabaseUtility.php.

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:
stdClass
Exceptions:
DBUnexpectedErrorThrown if the database returns an error

Reimplemented in MssqlResultWrapper, and FakeResultWrapper.

Definition at line 141 of file DatabaseUtility.php.

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 152 of file DatabaseUtility.php.

Free a result object.

Reimplemented in FakeResultWrapper.

Definition at line 159 of file DatabaseUtility.php.

Returns:
int

Definition at line 203 of file DatabaseUtility.php.

Returns:
stdClass

Reimplemented in FakeResultWrapper.

Definition at line 210 of file DatabaseUtility.php.

Get the number of rows in a result object.

Returns:
int

Reimplemented in FakeResultWrapper.

Definition at line 129 of file DatabaseUtility.php.

Referenced by rewind().

Reimplemented in FakeResultWrapper.

Definition at line 181 of file DatabaseUtility.php.

References numRows().

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 171 of file DatabaseUtility.php.

Returns:
bool

Definition at line 220 of file DatabaseUtility.php.


Member Data Documentation

object null ResultWrapper::$currentRow = null [protected]

*

Reimplemented in FakeResultWrapper.

Definition at line 106 of file DatabaseUtility.php.

DatabaseBase ResultWrapper::$db [protected]

*

Reimplemented in FakeResultWrapper.

Definition at line 102 of file DatabaseUtility.php.

int ResultWrapper::$pos = 0 [protected]

*

Reimplemented in FakeResultWrapper.

Definition at line 104 of file DatabaseUtility.php.

resource ResultWrapper::$result

*

Reimplemented in FakeResultWrapper.

Definition at line 100 of file DatabaseUtility.php.

Referenced by MssqlResultWrapper\fetchObject(), and MssqlResultWrapper\fetchRow().


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