|
MediaWiki master
|
WatchlistManager service. More...
Public Member Functions | |
| __construct (array $options, HookContainer $hookContainer, ReadOnlyMode $readOnlyMode, RevisionLookup $revisionLookup, TalkPageNotificationManager $talkPageNotificationManager, WatchedItemStoreInterface $watchedItemStore, private readonly WatchlistLabelStore $watchlistLabelStore, UserFactory $userFactory, NamespaceInfo $nsInfo, WikiPageFactory $wikiPageFactory) | |
| addWatch (Authority $performer, PageReference $target, ?string $expiry=null) | |
| Watch a page if the user has permission to edit their watchlist. | |
| addWatchIgnoringRights (UserIdentity $userIdentity, PageReference $target, ?string $expiry=null) | |
| Watch a page. | |
| clearAllUserNotifications (Authority $performer) | |
| Resets all of the given user's page-change notification timestamps. | |
| clearTitleUserNotifications (Authority $performer, PageReference $title, $oldRev=null, $oldRevDeprecated=null) | |
| Clear the user's notification timestamp for the given title. | |
| getTitleNotificationTimestamp (UserIdentity $user, PageReference $title) | |
| Get the timestamp when this page was updated since the user last saw it. | |
| isTempWatched (Authority $performer, PageReference $target) | |
| Check if the page is temporarily watched by the user and the user has permission to view their watchlist. | |
| isTempWatchedIgnoringRights (UserIdentity $userIdentity, PageReference $target) | |
| Check if the article is temporarily watched by the user. | |
| isWatchable (PageReference $target) | |
| isWatched (Authority $performer, PageReference $target) | |
| Check if the page is watched by the user and the user has permission to view their watchlist. | |
| isWatchedIgnoringRights (UserIdentity $userIdentity, PageReference $target) | |
| Check if the page is watched by the user. | |
| removeWatch (Authority $performer, PageReference $target) | |
| Stop watching a page if the user has permission to edit their watchlist. | |
| removeWatchIgnoringRights (UserIdentity $userIdentity, PageReference $target) | |
| Stop watching a page. | |
| setWatch (bool $watch, Authority $performer, PageReference $target, ?string $expiry=null, ?array $labels=null) | |
| Watch or unwatch a page, calling watch/unwatch hooks as appropriate. | |
Public Attributes | |
| const | OPTION_ENOTIF = 'isEnotifEnabled' |
| MediaWiki\Watchlist\WatchlistManager::__construct | ( | array | $options, |
| HookContainer | $hookContainer, | ||
| ReadOnlyMode | $readOnlyMode, | ||
| RevisionLookup | $revisionLookup, | ||
| TalkPageNotificationManager | $talkPageNotificationManager, | ||
| WatchedItemStoreInterface | $watchedItemStore, | ||
| private readonly WatchlistLabelStore | $watchlistLabelStore, | ||
| UserFactory | $userFactory, | ||
| NamespaceInfo | $nsInfo, | ||
| WikiPageFactory | $wikiPageFactory ) |
| array{isEnotifEnabled:bool} | $options | |
| HookContainer | $hookContainer | |
| ReadOnlyMode | $readOnlyMode | |
| RevisionLookup | $revisionLookup | |
| TalkPageNotificationManager | $talkPageNotificationManager | |
| WatchedItemStoreInterface | $watchedItemStore | |
| WatchlistLabelStore | $watchlistLabelStore | |
| UserFactory | $userFactory | |
| NamespaceInfo | $nsInfo | |
| WikiPageFactory | $wikiPageFactory |
Definition at line 104 of file WatchlistManager.php.
References MediaWiki\Watchlist\WatchlistManager\OPTION_ENOTIF.
| MediaWiki\Watchlist\WatchlistManager::addWatch | ( | Authority | $performer, |
| PageReference | $target, | ||
| ?string | $expiry = null ) |
Watch a page if the user has permission to edit their watchlist.
Calls the WatchArticle and WatchArticleComplete hooks.
| Authority | $performer | |
| PageReference | $target | |
| string | null | $expiry | Optional expiry timestamp in any format acceptable to wfTimestamp(), null will not create expiries, or leave them unchanged should they already exist. |
Definition at line 397 of file WatchlistManager.php.
| MediaWiki\Watchlist\WatchlistManager::addWatchIgnoringRights | ( | UserIdentity | $userIdentity, |
| PageReference | $target, | ||
| ?string | $expiry = null ) |
Watch a page.
Calls the WatchArticle and WatchArticleComplete hooks.
| UserIdentity | $userIdentity | |
| PageReference | $target | |
| string | null | $expiry | Optional expiry timestamp in any format acceptable to wfTimestamp(), null will not create expiries, or leave them unchanged should they already exist. |
Definition at line 357 of file WatchlistManager.php.
| MediaWiki\Watchlist\WatchlistManager::clearAllUserNotifications | ( | Authority | $performer | ) |
Resets all of the given user's page-change notification timestamps.
If e-notif e-mails are on, they will receive notification mails on the next change of any watched page.
| Authority | $performer |
Definition at line 136 of file WatchlistManager.php.
References MediaWiki\Permissions\Authority\getUser(), and MediaWiki\Permissions\Authority\isAllowed().
| MediaWiki\Watchlist\WatchlistManager::clearTitleUserNotifications | ( | Authority | $performer, |
| PageReference | $title, | ||
| $oldRev = null, | |||
| $oldRevDeprecated = null ) |
Clear the user's notification timestamp for the given title.
If e-notif e-mails are on, they will receive notification mails on the next change of the page if it's watched etc.
| Authority | $performer | |
| PageReference | $title | |
| RevisionRecord | null | int | $oldRev | The revision record, or null if the latest revision is used. Passing integer for $oldid is deprecated since 1.46 |
| RevisionRecord | null | $oldRevDeprecated | Deprecated since 1.46 |
Definition at line 179 of file WatchlistManager.php.
References MediaWiki\Page\PageReference\getDBkey(), MediaWiki\Page\PageReference\getNamespace(), MediaWiki\Permissions\Authority\getUser(), MediaWiki\Permissions\Authority\isAllowed(), NS_USER_TALK, and wfDeprecatedMsg().
| MediaWiki\Watchlist\WatchlistManager::getTitleNotificationTimestamp | ( | UserIdentity | $user, |
| PageReference | $title ) |
Get the timestamp when this page was updated since the user last saw it.
| UserIdentity | $user | |
| PageReference | $title |
Definition at line 248 of file WatchlistManager.php.
References MediaWiki\Page\PageReference\getDBkey(), MediaWiki\User\UserIdentity\getId(), MediaWiki\Page\PageReference\getNamespace(), and MediaWiki\User\UserIdentity\isRegistered().
Referenced by MediaWiki\Actions\Pager\HistoryPager\__construct(), and MediaWiki\Actions\HistoryAction\onView().
| MediaWiki\Watchlist\WatchlistManager::isTempWatched | ( | Authority | $performer, |
| PageReference | $target ) |
Check if the page is temporarily watched by the user and the user has permission to view their watchlist.
| Authority | $performer | |
| PageReference | $target |
Definition at line 341 of file WatchlistManager.php.
References MediaWiki\Permissions\Authority\getUser().
| MediaWiki\Watchlist\WatchlistManager::isTempWatchedIgnoringRights | ( | UserIdentity | $userIdentity, |
| PageReference | $target ) |
Check if the article is temporarily watched by the user.
| UserIdentity | $userIdentity | |
| PageReference | $target |
Definition at line 326 of file WatchlistManager.php.
| MediaWiki\Watchlist\WatchlistManager::isWatchable | ( | PageReference | $target | ) |
| PageReference | $target |
Definition at line 277 of file WatchlistManager.php.
| MediaWiki\Watchlist\WatchlistManager::isWatched | ( | Authority | $performer, |
| PageReference | $target ) |
Check if the page is watched by the user and the user has permission to view their watchlist.
| Authority | $performer | |
| PageReference | $target |
Definition at line 312 of file WatchlistManager.php.
References MediaWiki\Permissions\Authority\getUser().
| MediaWiki\Watchlist\WatchlistManager::isWatchedIgnoringRights | ( | UserIdentity | $userIdentity, |
| PageReference | $target ) |
Check if the page is watched by the user.
| UserIdentity | $userIdentity | |
| PageReference | $target |
Definition at line 297 of file WatchlistManager.php.
| MediaWiki\Watchlist\WatchlistManager::removeWatch | ( | Authority | $performer, |
| PageReference | $target ) |
Stop watching a page if the user has permission to edit their watchlist.
Calls the UnwatchArticle and UnwatchArticleComplete hooks.
| Authority | $performer | |
| PageReference | $target |
Definition at line 486 of file WatchlistManager.php.
| MediaWiki\Watchlist\WatchlistManager::removeWatchIgnoringRights | ( | UserIdentity | $userIdentity, |
| PageReference | $target ) |
Stop watching a page.
Calls the UnwatchArticle and UnwatchArticleComplete hooks.
| UserIdentity | $userIdentity | |
| PageReference | $target |
Definition at line 417 of file WatchlistManager.php.
| MediaWiki\Watchlist\WatchlistManager::setWatch | ( | bool | $watch, |
| Authority | $performer, | ||
| PageReference | $target, | ||
| ?string | $expiry = null, | ||
| ?array | $labels = null ) |
Watch or unwatch a page, calling watch/unwatch hooks as appropriate.
Checks before watching or unwatching to see if the page is already in the requested watch state and if the expiry is the same so it does not act unnecessarily.
| bool | $watch | Whether to watch or unwatch the page |
| Authority | $performer | who is watching/unwatching |
| PageReference | $target | Page to watch/unwatch |
| string | null | $expiry | Optional expiry timestamp in any format acceptable to wfTimestamp(), null will not create expiries, or leave them unchanged should they already exist. |
| ?int[] | $labels | Optional watchlist label IDs. |
Definition at line 512 of file WatchlistManager.php.
| const MediaWiki\Watchlist\WatchlistManager::OPTION_ENOTIF = 'isEnotifEnabled' |
Definition at line 42 of file WatchlistManager.php.
Referenced by MediaWiki\Watchlist\WatchlistManager\__construct().