|
MediaWiki master
|
Build and execute a query on the recentchanges table, optionally with joins and conditions. More...
Inherits MediaWiki\RecentChanges\ChangesListQuery\QueryBackend, and MediaWiki\RecentChanges\ChangesListQuery\JoinDependencyProvider.

Public Member Functions | ||||
| __construct (private ServiceOptions $config, private RecentChangeLookup $recentChangeLookup, private WatchedItemStoreInterface $watchedItemStore, private TempUserConfig $tempUserConfig, private UserFactory $userFactory, private LinkTargetLookup $linkTargetLookup, private ChangeTagsStore $changeTagsStore, private StatsFactory $statsFactory, private NameTableStore $slotRoleStore, private LoggerInterface $logger, private IReadableDatabase $db, private TableStatsProvider $rcStats,) | ||||
| addChangeTagSummaryField () | ||||
| Add the change tag summary field ts_tags. | ||||
| addRedirectField () | ||||
| Add the page_is_redirect field. | ||||
| adjustDensity ( $density) | ||||
Adjust the density heuristic by multiplying it by the given factor.This sets the proportion of recentchanges rows likely to be matched by the conditions.
| ||||
| allowDeletedLogAction () | ||||
| Override a previous call to excludeDeletedLogAction(), allowing deleted log rows to be shown. | ||||
| applyAction (string $verb, string $moduleName, $value=null) | ||||
| Apply an arbitrary action. | ||||
| audience (?Authority $authority) | ||||
| Set the Authority used for rc_deleted filters. | ||||
| caller (string $caller) | ||||
| Set the caller name to be passed down to the DBMS. | ||||
| commentFields () | ||||
| Add CommentStore fields: rc_comment_text, rc_comment_data, rc_comment_cid. | ||||
| denseRcSizeThreshold ( $threshold) | ||||
| Set the minimum size of the recentchanges table at which change tag queries will be conditionally modified based on estimated density. | ||||
| distinct () | ||||
Flag that the joins will inadvertently duplicate recentchanges rows and that the query will have to deal with that somehow, maybe by adding a DISTINCT option.
| ||||
| enablePartitioning () | ||||
| Enable query partitioning by timestamp, overriding the config. | ||||
| endAt (string $timestamp, ?int $id=null) | ||||
| Set the timestamp and ID for the end of the query results. | ||||
| excludeChangeTags ( $tagNames) | ||||
| Exclude changes matching any of the specified change tags. | ||||
| excludeDeletedLogAction () | ||||
| Exclude rows relating to log entries that have the DELETED_ACTION bit set, unless the configured audience has permission to view such rows. | ||||
| excludeDeletedUser () | ||||
| Exclude rows with the DELETED_USER bit set, unless the configured audience has permission to view such rows. | ||||
| excludeNamespaces (array $namespaces) | ||||
| Exclude namespaces by ID. | ||||
| excludeOldRevisions () | ||||
| Exclude old revisions. | ||||
| excludeUser (UserIdentity $user) | ||||
| Exclude changes by a specific user. | ||||
| excludeWatchlistLabelIds (array $labelIds) | ||||
| Require that the changed page is not watched with one of the specified watchlist label IDs. | ||||
| fetchResult () | ||||
| Execute the query and return the result. | ||||
| fields ( $fields) | ||||
| Add fields to the query. | ||||
| forceEmptySet () | ||||
| Set a flag forcing the query to return no rows when it is executed. | ||||
| forcePartitioning () | ||||
| Force partitioning, for testing. | ||||
| highlight (string $name, string $verb, string $moduleName, $value=null) | ||||
| Add a highlight to the query. | ||||
| isEmptySet () | ||||
| Check whether forceEmptySet() has been called. | ||||
| joinForConds (string $table) | ||||
Join on the specified table and declare that it will be used to provide fields for the WHERE clause.The table name must be registered in the ChangesListQuery. The join type can be set by calling a method on the returned object.
| ||||
| joinForFields (string $table) | ||||
Join on the specified table and declare that it will be used to provide fields for the SELECT clause.The table name must be registered in the ChangesListQuery. The join type can be set by calling a method on the returned object.
| ||||
| joinOrderHint ( $order) | ||||
| legacyMutator (callable $callback) | ||||
| Add a callback which will be called when building an SQL query. | ||||
| limit (int $limit) | ||||
| Set the maximum number of rows to return. | ||||
| maxExecutionTime (float|int|null $time) | ||||
| Set the maximum query execution time in seconds, or null to disable the time limit. | ||||
| maybeAddWatchlistExpiryField () | ||||
| Add the we_expiry field and its related join, if watchlist expiry is enabled. | ||||
| minTimestamp ( $timestamp) | ||||
| Set the minimum (earliest) rc_timestamp value. | ||||
| orderBy ( $sort) | ||||
| Set the sort order. | ||||
| rcUserFields () | ||||
Add the rc_user and rc_user_text fields to the query, conventional aliases for actor_user and actor_name.
| ||||
| recentChangeFields () | ||||
| Add fields to the query sufficient for the subsequent construction of RecentChange objects from the returned rows. | ||||
| registerFilter ( $name, ChangesListCondition $module) | ||||
| requireChangeTags ( $tagNames) | ||||
| Require that the change has one of the specified change tags. | ||||
| requireLatest () | ||||
| Require that the change is the latest change to the page. | ||||
| requireLink (string $direction, array $tables, PageIdentity $page) | ||||
| Require that the changed page links from or to the specified page, via the specified links tables. | ||||
| requireNamespaces (array $namespaces) | ||||
| Require namespaces by ID. | ||||
| requirePatrolled ( $value) | ||||
| Require a patrolled status. | ||||
| requireSlotChanged (string $role) | ||||
| Require that a specified slot role was modified. | ||||
| requireSources (array $sources) | ||||
| Require that the changes come from the specified sources, e.g. | ||||
| requireSubpageOf (LinkTarget|PageReference $page) | ||||
| Require that changed titles are subpages of a given page. | ||||
| requireTitle (LinkTarget|PageReference $title) | ||||
| Return only changes to a given page. | ||||
| requireUser (UserIdentity $user) | ||||
| Require changes by a specific user. | ||||
| requireWatched ( $watchTypes=[ 'watchedold', 'watchednew']) | ||||
| Require that the changed page is watched by the watchlist user specified in a call to watchlistUser(). | ||||
| requireWatchlistLabelIds (array $labelIds) | ||||
| Require that the changed page is watched with one of the specified watchlist label IDs. | ||||
| sha1Fields () | ||||
| Add the rev_deleted and rev_slot_pair fields, used by ApiQueryRecentChanges to deliver SHA-1 hashes for modified content. | ||||
| sortAndTruncate (array $inRows, ?int $limit, &$outRows) | ||||
| Sort rows by rc_timestamp/rc_id, remove any duplicates, and then truncate to the current query limit. | ||||
| sqbMutator (callable $callback) | ||||
| Add a callback which will be called with a SelectQueryBuilder during query construction. | ||||
| startAt (string $timestamp, ?int $id=null) | ||||
| Set the timestamp and ID for the start of the query results. | ||||
| watchlistFields ( $fields=[ 'wl_user', 'wl_notificationtimestamp', 'we_expiry']) | ||||
| Add watchlist fields to the query, and the relevant join. | ||||
| watchlistUser (UserIdentity $user) | ||||
| Set the user to be used for watchlist joins. | ||||
| where (IExpression $expr) | ||||
| Add a condition to the query. | ||||
Public Member Functions inherited from MediaWiki\RecentChanges\ChangesListQuery\QueryBackend | ||||
| joinOrderHint (string $order) | ||||
| Set the join order hint. | ||||
Public Attributes | |
| const | CONSTRUCTOR_OPTIONS |
| const | LINKS_FROM = 'from' |
| const | LINKS_TO = 'to' |
| const | PARTITION_THRESHOLD = 10000 |
| Minimum number of estimated rows before timestamp partitioning is considered. | |
| const | SORT_TIMESTAMP_ASC = 'timestamp-asc' |
| const | SORT_TIMESTAMP_DESC = 'timestamp-desc' |
Public Attributes inherited from MediaWiki\RecentChanges\ChangesListQuery\QueryBackend | |
| const | DENSITY_CHANGE_TAG_THRESHOLD = 'change-tag-threshold' |
| The minimum density to active change tag heuristics. | |
| const | DENSITY_LINKS = 'links' |
| The naive density of a RecentChangesLinked query. | |
| const | DENSITY_USER = 'user' |
| The naive density of a user/actor condition. | |
| const | DENSITY_WATCHLIST = 'watchlist' |
| The naive density of a watchlist query. | |
| const | JOIN_ORDER_OTHER = 'other' |
| Another table will likely be first in the join. | |
| const | JOIN_ORDER_RECENTCHANGES = 'recentchanges' |
| The recentchanges table will likely be first in the join. | |
Build and execute a query on the recentchanges table, optionally with joins and conditions.
Definition at line 43 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::__construct | ( | private ServiceOptions | $config, |
| private RecentChangeLookup | $recentChangeLookup, | ||
| private WatchedItemStoreInterface | $watchedItemStore, | ||
| private TempUserConfig | $tempUserConfig, | ||
| private UserFactory | $userFactory, | ||
| private LinkTargetLookup | $linkTargetLookup, | ||
| private ChangeTagsStore | $changeTagsStore, | ||
| private StatsFactory | $statsFactory, | ||
| private NameTableStore | $slotRoleStore, | ||
| private LoggerInterface | $logger, | ||
| private IReadableDatabase | $db, | ||
| private TableStatsProvider | $rcStats ) |
Definition at line 160 of file ChangesListQuery.php.
References MediaWiki\MainConfigNames\EnableChangesListQueryPartitioning, MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery\enablePartitioning(), MediaWiki\Config\ServiceOptions\get(), MediaWiki\MainConfigNames\MiserMode, MediaWiki\RecentChanges\RecentChange\PRC_AUTOPATROLLED, MediaWiki\RecentChanges\RecentChange\PRC_PATROLLED, MediaWiki\RecentChanges\RecentChange\PRC_UNPATROLLED, MediaWiki\MainConfigNames\RCMaxAge, and MediaWiki\MainConfigNames\WatchlistExpiry.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::addChangeTagSummaryField | ( | ) |
Add the change tag summary field ts_tags.
Definition at line 850 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::addRedirectField | ( | ) |
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::adjustDensity | ( | $density | ) |
Adjust the density heuristic by multiplying it by the given factor.This sets the proportion of recentchanges rows likely to be matched by the conditions.
| float | int | string | $density | Either a number or one of the self::DENSITY_* constants. |
Implements MediaWiki\RecentChanges\ChangesListQuery\QueryBackend.
Definition at line 689 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::allowDeletedLogAction | ( | ) |
Override a previous call to excludeDeletedLogAction(), allowing deleted log rows to be shown.
Definition at line 549 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::applyAction | ( | string | $verb, |
| string | $moduleName, | ||
| $value = null ) |
Apply an arbitrary action.
This is used to implement filter definitions in ChangesListSpecialPage. Other callers should add/use a separate mutator method. The details of the module names and values are internal and unstable.
Note regarding implicit unions:
Conventionally, if you require two things of the same kind, like two namespaces, you will get results matching either condition. But if you require two different kinds of condition, like a namespace and a minor edit, you will only get results matching both conditions. In other words, filter modules implement an implicit union of required values.
However, exclusions intersect with requirements of the same kind, so if you require minor edits, and also exclude minor edits, you get no results.
This convention is flexible, consistent, and works well with the UI.
| string | $verb | May be "require" or "exclude" |
| string | $moduleName | The name of the module, the thing to be required |
| mixed | $value | An optional value to pass to the module |
Definition at line 273 of file ChangesListQuery.php.
Referenced by MediaWiki\RecentChanges\ChangesListFilterGroup\modifyChangesListQuery().
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::audience | ( | ?Authority | $authority | ) |
Set the Authority used for rc_deleted filters.
| Authority | null | $authority |
Definition at line 583 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::caller | ( | string | $caller | ) |
Set the caller name to be passed down to the DBMS.
| string | $caller |
Definition at line 1599 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::commentFields | ( | ) |
Add CommentStore fields: rc_comment_text, rc_comment_data, rc_comment_cid.
Note that recentChangeFields() also adds rc_comment_text and rc_comment_data, but for comment_id it uses the alias rc_comment_id. If you call both then you will get both aliases. But the joins will be deduplicated.
Definition at line 955 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::denseRcSizeThreshold | ( | $threshold | ) |
Set the minimum size of the recentchanges table at which change tag queries will be conditionally modified based on estimated density.
| float | int | $threshold |
Definition at line 572 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::distinct | ( | ) |
Flag that the joins will inadvertently duplicate recentchanges rows and that the query will have to deal with that somehow, maybe by adding a DISTINCT option.
Implements MediaWiki\RecentChanges\ChangesListQuery\QueryBackend.
Definition at line 1622 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::enablePartitioning | ( | ) |
Enable query partitioning by timestamp, overriding the config.
Definition at line 748 of file ChangesListQuery.php.
Referenced by MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery\__construct().
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::endAt | ( | string | $timestamp, |
| ?int | $id = null ) |
Set the timestamp and ID for the end of the query results.
If the sort order is descending (the default) this is the minimum timestamp and ID. If the sort order is ascending, this is the maximum timestamp and ID. The ID, if specified, is used to break ties between results with equal timestamps.
| string | $timestamp | |
| int | null | $id |
Definition at line 659 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::excludeChangeTags | ( | $tagNames | ) |
Exclude changes matching any of the specified change tags.
| string[] | $tagNames |
Definition at line 465 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::excludeDeletedLogAction | ( | ) |
Exclude rows relating to log entries that have the DELETED_ACTION bit set, unless the configured audience has permission to view such rows.
Definition at line 538 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::excludeDeletedUser | ( | ) |
Exclude rows with the DELETED_USER bit set, unless the configured audience has permission to view such rows.
Definition at line 560 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::excludeNamespaces | ( | array | $namespaces | ) |
Exclude namespaces by ID.
| int[] | $namespaces |
Definition at line 305 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::excludeOldRevisions | ( | ) |
Exclude old revisions.
Latest revisions and changes that do not link to a revision, such as log entries, are allowed by this filter.
Definition at line 486 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::excludeUser | ( | UserIdentity | $user | ) |
Exclude changes by a specific user.
| UserIdentity | $user |
Definition at line 433 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::excludeWatchlistLabelIds | ( | array | $labelIds | ) |
Require that the changed page is not watched with one of the specified watchlist label IDs.
| int[] | $labelIds |
Definition at line 377 of file ChangesListQuery.php.
Referenced by MediaWiki\Specials\SpecialWatchlist\modifyQuery().
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::fetchResult | ( | ) |
Execute the query and return the result.
Definition at line 1025 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::fields | ( | $fields | ) |
Add fields to the query.
| string | string[] | $fields |
Implements MediaWiki\RecentChanges\ChangesListQuery\QueryBackend.
Definition at line 831 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::forceEmptySet | ( | ) |
Set a flag forcing the query to return no rows when it is executed.
Like adding a 0=1 condition.
Implements MediaWiki\RecentChanges\ChangesListQuery\QueryBackend.
Definition at line 716 of file ChangesListQuery.php.
Referenced by MediaWiki\RecentChanges\ChangesListFilterGroupContainer\modifyChangesListQuery(), MediaWiki\Specials\SpecialRecentChangesLinked\modifyQuery(), and MediaWiki\Specials\SpecialWatchlist\modifyQuery().
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::forcePartitioning | ( | ) |
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::highlight | ( | string | $name, |
| string | $verb, | ||
| string | $moduleName, | ||
| $value = null ) |
Add a highlight to the query.
A highlight is a client-side evaluation of a filter condition, given a caller-defined name. Results are available via ChangesListResult::getHighlightsFromRow().
If this is called more than once with the same name, the name will be available in the result if any of the actions matched.
This has no effect if it is called after the query is executed.
| string | $name | The arbitrary highlight name |
| string | $verb | The filter action verb, "require" or "exclude" |
| string | $moduleName | The module name, e.g. "bot" |
| mixed | $value | An optional value to pass to the filter module |
Definition at line 607 of file ChangesListQuery.php.
Referenced by MediaWiki\RecentChanges\ChangesListFilterGroup\modifyChangesListQuery().
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::isEmptySet | ( | ) |
Check whether forceEmptySet() has been called.
Note that the query may still return no rows even if this is false.
Implements MediaWiki\RecentChanges\ChangesListQuery\QueryBackend.
Definition at line 727 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::joinForConds | ( | string | $table | ) |
Join on the specified table and declare that it will be used to provide fields for the WHERE clause.The table name must be registered in the ChangesListQuery. The join type can be set by calling a method on the returned object.
| string | $table |
Implements MediaWiki\RecentChanges\ChangesListQuery\QueryBackend.
Definition at line 1610 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::joinForFields | ( | string | $table | ) |
Join on the specified table and declare that it will be used to provide fields for the SELECT clause.The table name must be registered in the ChangesListQuery. The join type can be set by calling a method on the returned object.
| string | $table |
Implements MediaWiki\RecentChanges\ChangesListQuery\QueryBackend.
Definition at line 1605 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::joinOrderHint | ( | $order | ) |
Definition at line 705 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::legacyMutator | ( | callable | $callback | ) |
Add a callback which will be called when building an SQL query.
It should have a signature like
function mutator( &$tables, &$fields, &$conds, &$options, &$join_conds )
The mutator function may either return void, or it may return false to indicate that the forceEmptySet flag should be set.
This should not be used in new code.
| callable | $callback |
Definition at line 996 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::limit | ( | int | $limit | ) |
Set the maximum number of rows to return.
| int | $limit |
Definition at line 682 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::maxExecutionTime | ( | float|int|null | $time | ) |
Set the maximum query execution time in seconds, or null to disable the time limit.
| float | int | null | $time |
Definition at line 738 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::maybeAddWatchlistExpiryField | ( | ) |
Add the we_expiry field and its related join, if watchlist expiry is enabled.
Definition at line 972 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::minTimestamp | ( | $timestamp | ) |
Set the minimum (earliest) rc_timestamp value.
| string | $timestamp | MW 14-char timestamp |
Definition at line 626 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::orderBy | ( | $sort | ) |
Set the sort order.
Must be one of the SORT_xxx constants.
| string | $sort |
Definition at line 671 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::rcUserFields | ( | ) |
Add the rc_user and rc_user_text fields to the query, conventional aliases for actor_user and actor_name.
Implements MediaWiki\RecentChanges\ChangesListQuery\QueryBackend.
Definition at line 838 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::recentChangeFields | ( | ) |
Add fields to the query sufficient for the subsequent construction of RecentChange objects from the returned rows.
Definition at line 861 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::registerFilter | ( | $name, | |
| ChangesListCondition | $module ) |
| string | $name | |
| ChangesListCondition | $module |
Definition at line 1632 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::requireChangeTags | ( | $tagNames | ) |
Require that the change has one of the specified change tags.
| string[] | $tagNames |
Definition at line 455 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::requireLatest | ( | ) |
Require that the change is the latest change to the page.
Changes that do not link to a page will not be shown.
Definition at line 475 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::requireLink | ( | string | $direction, |
| array | $tables, | ||
| PageIdentity | $page ) |
Require that the changed page links from or to the specified page, via the specified links tables.
| string | $direction | Either self::LINKS_FROM or self::LINKS_TO |
| string[] | $tables | |
| PageIdentity | $page |
Definition at line 390 of file ChangesListQuery.php.
Referenced by MediaWiki\Specials\SpecialRecentChangesLinked\modifyQuery().
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::requireNamespaces | ( | array | $namespaces | ) |
Require namespaces by ID.
| int[] | $namespaces |
Definition at line 295 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::requirePatrolled | ( | $value | ) |
Require a patrolled status.
| int | $value | One of the RecentChange::PRC_xxx constants |
Definition at line 444 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::requireSlotChanged | ( | string | $role | ) |
Require that a specified slot role was modified.
| string | $role |
Definition at line 497 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::requireSources | ( | array | $sources | ) |
Require that the changes come from the specified sources, e.g.
RecentChange::SRC_EDIT
| array | $sources |
Definition at line 412 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::requireSubpageOf | ( | LinkTarget|PageReference | $page | ) |
Require that changed titles are subpages of a given page.
| LinkTarget | PageReference | $page |
Definition at line 330 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::requireTitle | ( | LinkTarget|PageReference | $title | ) |
Return only changes to a given page.
| LinkTarget | PageReference | $title |
Definition at line 341 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::requireUser | ( | UserIdentity | $user | ) |
Require changes by a specific user.
| UserIdentity | $user |
Definition at line 422 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::requireWatched | ( | $watchTypes = [ 'watchedold', 'watchednew' ] | ) |
Require that the changed page is watched by the watchlist user specified in a call to watchlistUser().
| string[] | $watchTypes |
Definition at line 353 of file ChangesListQuery.php.
Referenced by MediaWiki\Specials\SpecialWatchlist\modifyQuery().
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::requireWatchlistLabelIds | ( | array | $labelIds | ) |
Require that the changed page is watched with one of the specified watchlist label IDs.
| int[] | $labelIds |
Definition at line 365 of file ChangesListQuery.php.
Referenced by MediaWiki\Specials\SpecialWatchlist\modifyQuery().
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::sha1Fields | ( | ) |
Add the rev_deleted and rev_slot_pair fields, used by ApiQueryRecentChanges to deliver SHA-1 hashes for modified content.
Definition at line 901 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::sortAndTruncate | ( | array | $inRows, |
| ?int | $limit, | ||
| & | $outRows ) |
Sort rows by rc_timestamp/rc_id, remove any duplicates, and then truncate to the current query limit.
| stdClass[] | $inRows | |
| int | null | $limit | |
| stdClass[] | &$outRows |
Definition at line 1405 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::sqbMutator | ( | callable | $callback | ) |
Add a callback which will be called with a SelectQueryBuilder during query construction.
It should have a signature like
function mutator( SelectQueryBuilder $queryBuilder ): void
The parameter may optionally be passed by reference and may be reassigned.
Instead consider integrating the functionality with this class.
| callable | $callback |
Definition at line 1015 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::startAt | ( | string | $timestamp, |
| ?int | $id = null ) |
Set the timestamp and ID for the start of the query results.
If the sort order is descending (the default) this is the maximum timestamp and ID. If the sort order is ascending, this is the minimum timestamp and ID. The ID, if specified, is used to break ties between results with equal timestamps.
| string | $timestamp | |
| int | null | $id |
Definition at line 642 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::watchlistFields | ( | $fields = [ 'wl_user', 'wl_notificationtimestamp', 'we_expiry' ] | ) |
Add watchlist fields to the query, and the relevant join.
If watchlist expiry is disabled, the we_expiry field will be omitted.
| string[] | $fields | The fields to add |
Definition at line 877 of file ChangesListQuery.php.
Referenced by MediaWiki\Specials\SpecialRecentChanges\modifyQuery().
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::watchlistUser | ( | UserIdentity | $user | ) |
Set the user to be used for watchlist joins.
| UserIdentity | $user |
Definition at line 817 of file ChangesListQuery.php.
| MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::where | ( | IExpression | $expr | ) |
Add a condition to the query.
| IExpression | $expr |
Implements MediaWiki\RecentChanges\ChangesListQuery\QueryBackend.
Definition at line 1588 of file ChangesListQuery.php.
| const MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::CONSTRUCTOR_OPTIONS |
Definition at line 44 of file ChangesListQuery.php.
| const MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::LINKS_FROM = 'from' |
Definition at line 52 of file ChangesListQuery.php.
| const MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::LINKS_TO = 'to' |
Definition at line 53 of file ChangesListQuery.php.
| const MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::PARTITION_THRESHOLD = 10000 |
Minimum number of estimated rows before timestamp partitioning is considered.
Definition at line 63 of file ChangesListQuery.php.
| const MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::SORT_TIMESTAMP_ASC = 'timestamp-asc' |
Definition at line 66 of file ChangesListQuery.php.
| const MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery::SORT_TIMESTAMP_DESC = 'timestamp-desc' |
Definition at line 65 of file ChangesListQuery.php.