+ // Based on ContribsPager.php
+ function getNamespaceCond() {
+ $namespace = $this->opts->getValue( 'namespace' );
+ if ( $namespace === 'all' || $namespace === '' ) {
+ return [];
+ }
+
+ $namespace = intval( $namespace );
+ $invert = $this->opts->getValue( 'invert' );
+ $associated = $this->opts->getValue( 'associated' );
+
+ $eq_op = $invert ? '!=' : '=';
+ $bool_op = $invert ? 'AND' : 'OR';
+
+ if ( !$associated ) {
+ return [ "rc_namespace $eq_op " . $this->mDb->addQuotes( $namespace ) ];
+ }
+
+ $associatedNS = MediaWikiServices::getInstance()->getNamespaceInfo()->getAssociated( $namespace );
+ return [
+ "rc_namespace $eq_op " . $this->mDb->addQuotes( $namespace ) .
+ $bool_op .
+ " rc_namespace $eq_op " . $this->mDb->addQuotes( $associatedNS )
+ ];
+ }
+