|
MediaWiki master
|
Check if a recentchange row is watched by the current watchlist user. More...
Inherits MediaWiki\RecentChanges\ChangesListQuery\ChangesListConditionBase.

Public Member Functions | |||||||
| __construct (private bool $enableExpiry) | |||||||
| evaluate (stdClass $row, $value) | |||||||
Evaluate the filter condition against a row, determining whether it is true or false.Ignore the values set with require() and exclude(), use only the value passed as a parameter.To ensure that $row has the required fields present, capture() must be called before evaluate(). This will signal to prepareQuery() that the fields should be added.
| |||||||
| setUser (UserIdentity $user) | |||||||
| validateValue ( $value) | |||||||
Public Member Functions inherited from MediaWiki\RecentChanges\ChangesListQuery\ChangesListConditionBase | |||||||
| capture () | |||||||
| Set a flag indicating that evaluate() will be called with rows from the query result. | |||||||
| isCaptured () | |||||||
Check whether capture() has been called.
| |||||||
Public Member Functions inherited from MediaWiki\RecentChanges\ChangesListQuery\ChangesListCondition | |||||||
| exclude ( $value) | |||||||
| Add a value to the set of excluded values. | |||||||
| prepareQuery (IReadableDatabase $dbr, QueryBackend $query) | |||||||
| Add conditions and joins to the query in order to implement require() and exclude(). | |||||||
Protected Member Functions | |||||||
| prepareCapture (IReadableDatabase $dbr, QueryBackend $query) | |||||||
| prepareConds (IReadableDatabase $dbr, QueryBackend $query) | |||||||
Add conditions to the query according to the values passed to require() and exclude().Subclasses may use getUniqueValuesWithUnion() to get the required and excluded values.
| |||||||
Additional Inherited Members | |
Public Attributes inherited from MediaWiki\RecentChanges\ChangesListQuery\ChangesListConditionBase | |
| function | |
Public Attributes inherited from MediaWiki\RecentChanges\ChangesListQuery\ChangesListCondition | |
| function | |
| Add a value to the set of required values. | |
Protected Attributes inherited from MediaWiki\RecentChanges\ChangesListQuery\ChangesListConditionBase | |
| array | $excluded = [] |
| array | $required = [] |
Check if a recentchange row is watched by the current watchlist user.
Optionally check if the change is a "new" change.
Definition at line 20 of file WatchedCondition.php.
| MediaWiki\RecentChanges\ChangesListQuery\WatchedCondition::__construct | ( | private bool | $enableExpiry | ) |
Definition at line 25 of file WatchedCondition.php.
| MediaWiki\RecentChanges\ChangesListQuery\WatchedCondition::evaluate | ( | stdClass | $row, |
| $value ) |
Evaluate the filter condition against a row, determining whether it is true or false.Ignore the values set with require() and exclude(), use only the value passed as a parameter.To ensure that $row has the required fields present, capture() must be called before evaluate(). This will signal to prepareQuery() that the fields should be added.
| stdClass | $row | |
| mixed | $value | The validated value |
Implements MediaWiki\RecentChanges\ChangesListQuery\ChangesListCondition.
Definition at line 44 of file WatchedCondition.php.
|
protected |
Definition at line 62 of file WatchedCondition.php.
References MediaWiki\RecentChanges\ChangesListQuery\QueryBackend\fields(), and MediaWiki\RecentChanges\ChangesListQuery\QueryBackend\joinForFields().
|
protected |
Add conditions to the query according to the values passed to require() and exclude().Subclasses may use getUniqueValuesWithUnion() to get the required and excluded values.
| IReadableDatabase | $dbr | |
| QueryBackend | $query |
Reimplemented from MediaWiki\RecentChanges\ChangesListQuery\ChangesListConditionBase.
Definition at line 75 of file WatchedCondition.php.
References MediaWiki\RecentChanges\ChangesListQuery\QueryBackend\adjustDensity(), MediaWiki\RecentChanges\ChangesListQuery\QueryBackend\DENSITY_WATCHLIST, Wikimedia\Rdbms\IReadableDatabase\expr(), MediaWiki\RecentChanges\ChangesListQuery\QueryBackend\forceEmptySet(), MediaWiki\RecentChanges\ChangesListQuery\QueryBackend\JOIN_ORDER_OTHER, MediaWiki\RecentChanges\ChangesListQuery\QueryBackend\joinForConds(), Wikimedia\Rdbms\IReadableDatabase\orExpr(), Wikimedia\Rdbms\Platform\ISQLPlatform\timestamp(), and MediaWiki\RecentChanges\ChangesListQuery\QueryBackend\where().
| MediaWiki\RecentChanges\ChangesListQuery\WatchedCondition::setUser | ( | UserIdentity | $user | ) |
Definition at line 28 of file WatchedCondition.php.
References MediaWiki\User\UserIdentity\getId().
| MediaWiki\RecentChanges\ChangesListQuery\WatchedCondition::validateValue | ( | $value | ) |
| string | $value |
Implements MediaWiki\RecentChanges\ChangesListQuery\ChangesListCondition.
Definition at line 36 of file WatchedCondition.php.