* @ingroup Pager
*/
-use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IResultWrapper;
use Wikimedia\Rdbms\IDatabase;
/**
/**
* Result object for the query. Warning: seek before use.
*
- * @var ResultWrapper
+ * @var IResultWrapper
*/
public $mResult;
: [];
} elseif ( is_array( $index ) ) {
# First element is the default
- reset( $index );
- list( $this->mOrderType, $this->mIndexField ) = each( $index );
+ $this->mIndexField = reset( $index );
+ $this->mOrderType = key( $index );
$this->mExtraSortFields = isset( $extraSort[$this->mOrderType] )
? (array)$extraSort[$this->mOrderType]
: [];
}
/**
- * @return ResultWrapper The result wrapper.
+ * @return IResultWrapper The result wrapper.
*/
function getResult() {
return $this->mResult;
* @param bool $isFirst False if there are rows before those fetched (i.e.
* if a "previous" link would make sense)
* @param int $limit Exact query limit
- * @param ResultWrapper $res
+ * @param IResultWrapper $res
*/
- function extractResultInfo( $isFirst, $limit, ResultWrapper $res ) {
+ function extractResultInfo( $isFirst, $limit, IResultWrapper $res ) {
$numRows = $res->numRows();
if ( $numRows ) {
# Remove any table prefix from index field
* @param string $offset Index offset, inclusive
* @param int $limit Exact query limit
* @param bool $descending Query direction, false for ascending, true for descending
- * @return ResultWrapper
+ * @return IResultWrapper
*/
public function reallyDoQuery( $offset, $limit, $descending ) {
list( $tables, $fields, $conds, $fname, $options, $join_conds ) =
/**
* Pre-process results; useful for performing batch existence checks, etc.
*
- * @param ResultWrapper $result
+ * @param IResultWrapper $result
*/
protected function preprocessResults( $result ) {
}
* @return bool
*/
protected function getDefaultDirections() {
- return IndexPager::DIR_ASCENDING;
+ return self::DIR_ASCENDING;
}
}