MediaWiki
1.32.5
|
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. 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... | |
seek ( $row) | |
Change the position of the cursor in a result object. More... | |
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\ResultWrapper, Wikimedia\Rdbms\FakeResultWrapper, and Wikimedia\Rdbms\MssqlResultWrapper.
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\ResultWrapper, Wikimedia\Rdbms\MssqlResultWrapper, and Wikimedia\Rdbms\FakeResultWrapper.
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\ResultWrapper, and Wikimedia\Rdbms\FakeResultWrapper.
Wikimedia\Rdbms\IResultWrapper::key | ( | ) |
Implemented in Wikimedia\Rdbms\ResultWrapper.
Wikimedia\Rdbms\IResultWrapper::next | ( | ) |
Implemented in Wikimedia\Rdbms\ResultWrapper, and Wikimedia\Rdbms\FakeResultWrapper.
Wikimedia\Rdbms\IResultWrapper::numRows | ( | ) |
Get the number of rows in a result object.
Implemented in Wikimedia\Rdbms\ResultWrapper, and Wikimedia\Rdbms\FakeResultWrapper.
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\ResultWrapper, Wikimedia\Rdbms\MssqlResultWrapper, and Wikimedia\Rdbms\FakeResultWrapper.