return $this->mResolveRedirects;
}
+ /**
+ * Return the parameter name that is the source of data for this PageSet
+ *
+ * If multiple source parameters are specified (e.g. titles and pageids),
+ * one will be named arbitrarily.
+ *
+ * @return string|null
+ */
+ public function getDataSource() {
+ if ( $this->mAllowGenerator && isset( $this->mParams['generator'] ) ) {
+ return 'generator';
+ }
+ if ( isset( $this->mParams['titles'] ) ) {
+ return 'titles';
+ }
+ if ( isset( $this->mParams['pageids'] ) ) {
+ return 'pageids';
+ }
+ if ( isset( $this->mParams['revids'] ) ) {
+ return 'revids';
+ }
+ return null;
+ }
+
/**
* Request an additional field from the page table.
* Must be called before execute()
$this->requireMaxOneParameter( $params, 'timestamp', 'torevid', 'newerthanrevid' );
$pageSet = $this->getPageSet();
- $args = array_merge( array( $params, 'entirewatchlist' ), array_keys( $pageSet->getAllowedParams() ) );
- call_user_func_array( array( $this, 'requireOnlyOneParameter' ), $args );
+ if ( $params['entirewatchlist'] && $pageSet->getDataSource() !== null ) {
+ $this->dieUsage( "Cannot use 'entirewatchlist' at the same time as '{$pageSet->getDataSource()}'", 'multisource' );
+ }
$dbw = wfGetDB( DB_MASTER, 'api' );