- $this->addTables( 'watchlist' );
- $this->addFields( [ 'wl_namespace', 'wl_title' ] );
- $this->addFieldsIf( 'wl_notificationtimestamp', isset( $prop['changed'] ) );
- $this->addWhereFld( 'wl_user', $user->getId() );
- $this->addWhereFld( 'wl_namespace', $params['namespace'] );
- $this->addWhereIf( 'wl_notificationtimestamp IS NOT NULL', isset( $show['changed'] ) );
- $this->addWhereIf( 'wl_notificationtimestamp IS NULL', isset( $show['!changed'] ) );
+ $options = [];
+ if ( $params['namespace'] ) {
+ $options['namespaceIds'] = $params['namespace'];
+ }
+ if ( isset( $show[WatchedItemQueryService::FILTER_CHANGED] ) ) {
+ $options['filter'] = WatchedItemQueryService::FILTER_CHANGED;
+ }
+ if ( isset( $show[WatchedItemQueryService::FILTER_NOT_CHANGED] ) ) {
+ $options['filter'] = WatchedItemQueryService::FILTER_NOT_CHANGED;
+ }