MediaWiki  master
WatchedItemStoreInterface.php
Go to the documentation of this file.
1 <?php
25 
31 
35  const SORT_ASC = 'ASC';
36 
40  const SORT_DESC = 'DESC';
41 
52  public function countWatchedItems( UserIdentity $user );
53 
61  public function countWatchers( LinkTarget $target );
62 
75  public function countVisitingWatchers( LinkTarget $target, $threshold );
76 
88  public function countWatchersMultiple( array $targets, array $options = [] );
89 
110  public function countVisitingWatchersMultiple(
111  array $targetsWithVisitThresholds,
112  $minimumWatchers = null
113  );
114 
125  public function getWatchedItem( UserIdentity $user, LinkTarget $target );
126 
137  public function loadWatchedItem( UserIdentity $user, LinkTarget $target );
138 
150  public function getWatchedItemsForUser( UserIdentity $user, array $options = [] );
151 
162  public function isWatched( UserIdentity $user, LinkTarget $target );
163 
175  public function getNotificationTimestampsBatch( UserIdentity $user, array $targets );
176 
185  public function addWatch( UserIdentity $user, LinkTarget $target );
186 
195  public function addWatchBatchForUser( UserIdentity $user, array $targets );
196 
210  public function removeWatch( UserIdentity $user, LinkTarget $target );
211 
221  public function setNotificationTimestampsForUser(
223  $timestamp,
224  array $targets = []
225  );
226 
235 
246  public function updateNotificationTimestamp(
247  UserIdentity $editor, LinkTarget $target, $timestamp );
248 
264  public function resetNotificationTimestamp(
265  UserIdentity $user, LinkTarget $title, $force = '', $oldid = 0 );
266 
276  public function countUnreadNotifications( UserIdentity $user, $unreadLimit = null );
277 
289  public function duplicateAllAssociatedEntries( LinkTarget $oldTarget, LinkTarget $newTarget );
290 
303  public function duplicateEntry( LinkTarget $oldTarget, LinkTarget $newTarget );
304 
312  public function clearUserWatchedItems( UserIdentity $user );
313 
322 
331  public function removeWatchBatchForUser( UserIdentity $user, array $targets );
332 
346  public function getLatestNotificationTimestamp(
347  $timestamp, UserIdentity $user, LinkTarget $target );
348 }
getNotificationTimestampsBatch(UserIdentity $user, array $targets)
removeWatch(UserIdentity $user, LinkTarget $target)
Removes an entry for the UserIdentity watching the LinkTarget Must be called separately for Subject &...
clearUserWatchedItemsUsingJobQueue(UserIdentity $user)
Queues a job that will clear the users watchlist using the Job Queue.
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
updateNotificationTimestamp(UserIdentity $editor, LinkTarget $target, $timestamp)
countUnreadNotifications(UserIdentity $user, $unreadLimit=null)
resetNotificationTimestamp(UserIdentity $user, LinkTarget $title, $force='', $oldid=0)
Reset the notification timestamp of this entry.
getWatchedItemsForUser(UserIdentity $user, array $options=[])
addWatch(UserIdentity $user, LinkTarget $target)
Must be called separately for Subject & Talk namespaces.
duplicateAllAssociatedEntries(LinkTarget $oldTarget, LinkTarget $newTarget)
Check if the given title already is watched by the user, and if so add a watch for the new title...
countWatchersMultiple(array $targets, array $options=[])
Interface for objects representing user identity.
countWatchers(LinkTarget $target)
loadWatchedItem(UserIdentity $user, LinkTarget $target)
Loads an item from the db.
duplicateEntry(LinkTarget $oldTarget, LinkTarget $newTarget)
Check if the given title already is watched by the user, and if so add a watch for the new title...
isWatched(UserIdentity $user, LinkTarget $target)
Must be called separately for Subject & Talk namespaces.
getWatchedItem(UserIdentity $user, LinkTarget $target)
Get an item (may be cached)
getLatestNotificationTimestamp( $timestamp, UserIdentity $user, LinkTarget $target)
Convert $timestamp to TS_MW or return null if the page was visited since then by $user.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped & $options
Definition: hooks.txt:1972
countVisitingWatchers(LinkTarget $target, $threshold)
Number of page watchers who also visited a "recent" edit.
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that When $user is not null
Definition: hooks.txt:767
namespace and then decline to actually register it file or subcat img or subcat $title
Definition: hooks.txt:912
removeWatchBatchForUser(UserIdentity $user, array $targets)
countVisitingWatchersMultiple(array $targetsWithVisitThresholds, $minimumWatchers=null)
Number of watchers of each page who have visited recent edits to that page.
setNotificationTimestampsForUser(UserIdentity $user, $timestamp, array $targets=[])
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition: injection.txt:35
countWatchedItems(UserIdentity $user)
Count the number of individual items that are watched by the user.
clearUserWatchedItems(UserIdentity $user)
Queues a job that will clear the users watchlist using the Job Queue.
resetAllNotificationTimestampsForUser(UserIdentity $user)
Reset all watchlist notificaton timestamps for a user using the job queue.
passed in as a query string parameter to the various URLs constructed here(i.e. $prevlink) $ldel you ll need to handle error etc yourself modifying $error and returning true will cause the contents of $error to be echoed at the top of the edit form as wikitext Return true without altering $error to allow the edit to proceed & $editor
Definition: hooks.txt:1268
return true to allow those checks to and false if checking is done & $user
Definition: hooks.txt:1454
addWatchBatchForUser(UserIdentity $user, array $targets)