MediaWiki REL1_32
|
Result wrapper for grabbing data queried from an IDatabase object. More...
Public Member Functions | |
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. | |
seek ( $row) | |
Change the position of the cursor in a result object. | |
Result wrapper for grabbing data queried from an IDatabase object.
Note that using the Iterator methods in combination with the non-Iterator DB result iteration functions may cause rows to be skipped or repeated.
By default, this will use the iteration methods of the IDatabase handle if provided. Subclasses can override methods to make it solely work on the result resource instead. If no database is provided, and the subclass does not override the DB iteration methods, then a RuntimeException will be thrown when iteration is attempted.
The result resource field should not be accessed from non-Database related classes. It is database class specific and is stored here to associate iterators with queries.
Definition at line 24 of file IResultWrapper.php.
Wikimedia\Rdbms\IResultWrapper::current | ( | ) |
Implemented in Wikimedia\Rdbms\ResultWrapper.
Wikimedia\Rdbms\IResultWrapper::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. If no more rows are available, false is returned.
DBUnexpectedError | Thrown if the database returns an error |
Implemented in Wikimedia\Rdbms\FakeResultWrapper, Wikimedia\Rdbms\MssqlResultWrapper, and Wikimedia\Rdbms\ResultWrapper.
Wikimedia\Rdbms\IResultWrapper::fetchRow | ( | ) |
Fetch the next row from the given result object, in associative array form.
Fields are retrieved with $row['fieldname']. If no more rows are available, false is returned.
DBUnexpectedError | Thrown if the database returns an error |
Implemented in Wikimedia\Rdbms\FakeResultWrapper, Wikimedia\Rdbms\MssqlResultWrapper, and Wikimedia\Rdbms\ResultWrapper.
Wikimedia\Rdbms\IResultWrapper::free | ( | ) |
Free a result object.
This either saves memory in PHP (buffered queries) or on the server (unbuffered queries). In general, queries are not large enough in result sets for this to be worth calling.
Implemented in Wikimedia\Rdbms\FakeResultWrapper, and Wikimedia\Rdbms\ResultWrapper.
Wikimedia\Rdbms\IResultWrapper::key | ( | ) |
Implemented in Wikimedia\Rdbms\ResultWrapper.
Wikimedia\Rdbms\IResultWrapper::next | ( | ) |
Implemented in Wikimedia\Rdbms\FakeResultWrapper, and Wikimedia\Rdbms\ResultWrapper.
Wikimedia\Rdbms\IResultWrapper::numRows | ( | ) |
Get the number of rows in a result object.
Implemented in Wikimedia\Rdbms\FakeResultWrapper, and Wikimedia\Rdbms\ResultWrapper.
Wikimedia\Rdbms\IResultWrapper::seek | ( | $row | ) |
Change the position of the cursor in a result object.
See mysql_data_seek()
int | $row |
Implemented in Wikimedia\Rdbms\FakeResultWrapper, Wikimedia\Rdbms\MssqlResultWrapper, and Wikimedia\Rdbms\ResultWrapper.