*/
public function getRcIdIfUnpatrolled( RevisionRecord $rev ) {
$rc = $this->getRecentChange( $rev );
- if ( $rc && $rc->getAttribute( 'rc_patrolled' ) == 0 ) {
+ if ( $rc && $rc->getAttribute( 'rc_patrolled' ) == RecentChange::PRC_UNPATROLLED ) {
return $rc->getAttribute( 'rc_id' );
} else {
return 0;
$dbw->update( 'recentchanges',
[
'rc_deleted' => $bits,
- 'rc_patrolled' => 1
+ 'rc_patrolled' => RecentChange::PRC_PATROLLED
],
[
'rc_logid' => $this->row->log_id,
$dbw->update( 'recentchanges',
[
'rc_deleted' => $bits,
- 'rc_patrolled' => 1
+ 'rc_patrolled' => RecentChange::PRC_PATROLLED
],
[
'rc_this_oldid' => $this->revision->getId(), // condition
'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
&$query_options, &$join_conds
) {
- $conds[] = 'rc_patrolled = 0';
+ $conds['rc_patrolled'] = RecentChange::PRC_UNPATROLLED;
},
'isReplacedInStructuredUi' => true,
],
'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
&$query_options, &$join_conds
) {
- $conds[] = 'rc_patrolled != 0';
+ $conds[] = 'rc_patrolled != ' . RecentChange::PRC_UNPATROLLED;
},
'isReplacedInStructuredUi' => true,
],
$tables[] = 'recentchanges';
$conds['rc_type'] = RC_LOG;
$conds['rc_log_type'] = 'upload';
- $conds['rc_patrolled'] = 0;
+ $conds['rc_patrolled'] = RecentChange::PRC_UNPATROLLED;
$conds['rc_namespace'] = NS_FILE;
if ( $wgActorTableSchemaMigrationStage === MIGRATION_NEW ) {
# If this user cannot see patrolled edits or they are off, don't do dumb queries!
if ( $this->opts->getValue( 'hidepatrolled' ) && $this->getUser()->useNPPatrol() ) {
- $conds['rc_patrolled'] = 0;
+ $conds['rc_patrolled'] = RecentChange::PRC_UNPATROLLED;
}
if ( $this->opts->getValue( 'hidebots' ) ) {
// TODO: not sure if this should simply ignore patrolled filters if user does not have the patrol
// right, or maybe rather fail loud at this point, same as e.g. ApiQueryWatchlist does?
if ( in_array( self::FILTER_PATROLLED, $options['filters'] ) ) {
- $conds[] = 'rc_patrolled != 0';
+ $conds[] = 'rc_patrolled != ' . RecentChange::PRC_UNPATROLLED;
} elseif ( in_array( self::FILTER_NOT_PATROLLED, $options['filters'] ) ) {
- $conds[] = 'rc_patrolled = 0';
+ $conds['rc_patrolled'] = RecentChange::PRC_UNPATROLLED;
}
if ( in_array( self::FILTER_AUTOPATROLLED, $options['filters'] ) ) {
- $conds[] = 'rc_patrolled = 2';
+ $conds['rc_patrolled'] = RecentChange::PRC_AUTOPATROLLED;
} elseif ( in_array( self::FILTER_NOT_AUTOPATROLLED, $options['filters'] ) ) {
- $conds[] = 'rc_patrolled != 2';
+ $conds[] = 'rc_patrolled != ' . RecentChange::PRC_AUTOPATROLLED;
}
}
null,
[],
[],
- [ 'rc_patrolled = 0' ],
+ [ 'rc_patrolled' => 0 ],
[],
[],
],