/**
* Add a set of tables to the internal array
- * @param mixed $tables Table name or array of table names
- * @param mixed $alias Table alias, or null for no alias. Cannot be
+ * @param string|string[] $tables Table name or array of table names
+ * @param string|null $alias Table alias, or null for no alias. Cannot be
* used with multiple tables
*/
protected function addTables( $tables, $alias = null ) {
/**
* Set a query-continue value
* @param string $paramName Parameter name
- * @param string $paramValue Parameter value
+ * @param string|array $paramValue Parameter value
*/
protected function setContinueEnumParameter( $paramName, $paramValue ) {
- $paramName = $this->encodeParamName( $paramName );
- $msg = array( $paramName => $paramValue );
- $result = $this->getResult();
- $result->disableSizeCheck();
- $result->addValue( 'query-continue', $this->getModuleName(), $msg, ApiResult::ADD_ON_TOP );
- $result->enableSizeCheck();
+ $this->getResult()->setContinueParam( $this, $paramName, $paramValue );
}
/**
return preg_match( '/^[a-z0-9]{31}$/', $hash );
}
- /**
- * @return array
- */
- public function getPossibleErrors() {
- $errors = parent::getPossibleErrors();
- $errors = array_merge( $errors, array(
- array( 'invalidtitle', 'title' ),
- array( 'invalidtitle', 'key' ),
- ) );
-
- return $errors;
- }
-
/**
* Check whether the current user has permission to view revision-deleted
* fields.
* @return bool
*/
public function userCanSeeRevDel() {
- return $this->getUser()->isAllowedAny( 'deletedhistory', 'deletedtext', 'suppressrevision' );
+ return $this->getUser()->isAllowedAny(
+ 'deletedhistory',
+ 'deletedtext',
+ 'suppressrevision',
+ 'viewsuppressed'
+ );
}
}
}
/**
- * Overrides base in case of generator & smart continue to
- * notify ApiQueryMain instead of adding them to the result right away.
+ * Overridden to set the generator param if in generator mode
* @param string $paramName Parameter name
- * @param string $paramValue Parameter value
+ * @param string|array $paramValue Parameter value
*/
protected function setContinueEnumParameter( $paramName, $paramValue ) {
- // If this is a generator and query->setGeneratorContinue() returns false, treat as before
- if ( $this->mGeneratorPageSet === null
- || !$this->getQuery()->setGeneratorContinue( $this, $paramName, $paramValue )
- ) {
+ if ( $this->mGeneratorPageSet !== null ) {
+ $this->getResult()->setGeneratorContinueParam( $this, $paramName, $paramValue );
+ } else {
parent::setContinueEnumParameter( $paramName, $paramValue );
}
}