|
MediaWiki
REL1_24
|
Representation of a pair of user and title for watchlist entries. More...

Public Member Functions | |
| addWatch () | |
| Given a title and user (assumes the object is setup), add the watch to the database. | |
| getNotificationTimestamp () | |
| Get the notification timestamp of this entry. | |
| isWatched () | |
| Is mTitle being watched by mUser? | |
| removeWatch () | |
| Same as addWatch, only the opposite. | |
| resetNotificationTimestamp ($force= '', $oldid=0) | |
| Reset the notification timestamp of this entry. | |
Static Public Member Functions | |
| static | batchAddWatch (array $items) |
| static | duplicateEntries ($ot, $nt) |
| Check if the given title already is watched by the user, and if so add watches on a new title. | |
| static | fromUserTitle ($user, $title, $checkRights=WatchedItem::CHECK_USER_RIGHTS) |
| Create a WatchedItem object with the given user and title. | |
Public Attributes | |
| int | $mCheckRights |
| * | |
| Title | $mTitle |
| * | |
| User | $mUser |
| * | |
| const | CHECK_USER_RIGHTS = 1 |
| Constant to specify that user rights 'editmywatchlist' and 'viewmywatchlist' should be checked. | |
| const | IGNORE_USER_RIGHTS = 0 |
| Constant to specify that user rights 'editmywatchlist' and 'viewmywatchlist' should not be checked. | |
Protected Member Functions | |
| getTitle () | |
| Title being watched. | |
| getTitleDBkey () | |
| Helper to retrieve the title DBkey. | |
| getTitleNs () | |
| Helper to retrieve the title namespace. | |
| getUserId () | |
| Helper to retrieve the user id. | |
Private Member Functions | |
| dbCond () | |
| Return an array of conditions to select or update the appropriate database row. | |
| isAllowed ($what) | |
| Check permissions. | |
| load () | |
| Load the object from the database. | |
Static Private Member Functions | |
| static | doDuplicateEntries ($ot, $nt) |
| Handle duplicate entries. | |
Private Attributes | |
| bool | $loaded = false |
| * | |
| string | $timestamp |
| * | |
| bool | $watched |
| * | |
Representation of a pair of user and title for watchlist entries.
Definition at line 29 of file WatchedItem.php.
Given a title and user (assumes the object is setup), add the watch to the database.
Definition at line 319 of file WatchedItem.php.
| static WatchedItem::batchAddWatch | ( | array $ | items | ) | [static] |
| WatchedItem::dbCond | ( | ) | [private] |
Return an array of conditions to select or update the appropriate database row.
Definition at line 114 of file WatchedItem.php.
| static WatchedItem::doDuplicateEntries | ( | $ | ot, |
| $ | nt | ||
| ) | [static, private] |
Handle duplicate entries.
Backend for duplicateEntries().
Definition at line 391 of file WatchedItem.php.
| static WatchedItem::duplicateEntries | ( | $ | ot, |
| $ | nt | ||
| ) | [static] |
| static WatchedItem::fromUserTitle | ( | $ | user, |
| $ | title, | ||
| $ | checkRights = WatchedItem::CHECK_USER_RIGHTS |
||
| ) | [static] |
Create a WatchedItem object with the given user and title.
| User | $user | The user to use for (un)watching |
| Title | $title | The title we're going to (un)watch |
| int | $checkRights | Whether to check the 'viewmywatchlist' and 'editmywatchlist' rights. Pass either WatchedItem::IGNORE_USER_RIGHTS or WatchedItem::CHECK_USER_RIGHTS. |
Definition at line 65 of file WatchedItem.php.
Get the notification timestamp of this entry.
Definition at line 186 of file WatchedItem.php.
| WatchedItem::getTitle | ( | ) | [protected] |
| WatchedItem::getTitleDBkey | ( | ) | [protected] |
| WatchedItem::getTitleNs | ( | ) | [protected] |
| WatchedItem::getUserId | ( | ) | [protected] |
| WatchedItem::isAllowed | ( | $ | what | ) | [private] |
Check permissions.
| string | $what | 'viewmywatchlist' or 'editmywatchlist' |
Definition at line 163 of file WatchedItem.php.
| WatchedItem::load | ( | ) | [private] |
Load the object from the database.
Definition at line 125 of file WatchedItem.php.
| WatchedItem::resetNotificationTimestamp | ( | $ | force = '', |
| $ | oldid = 0 |
||
| ) |
Reset the notification timestamp of this entry.
| bool | $force | Whether to force the write query to be executed even if the page is not watched or the notification timestamp is already NULL. |
| int | $oldid | The revision id being viewed. If not given or 0, latest revision is assumed. |
Definition at line 206 of file WatchedItem.php.
bool WatchedItem::$loaded = false [private] |
*
Definition at line 50 of file WatchedItem.php.
| int WatchedItem::$mCheckRights |
*
Definition at line 48 of file WatchedItem.php.
| Title WatchedItem::$mTitle |
*
Definition at line 44 of file WatchedItem.php.
| User WatchedItem::$mUser |
*
Definition at line 46 of file WatchedItem.php.
string WatchedItem::$timestamp [private] |
*
Definition at line 54 of file WatchedItem.php.
bool WatchedItem::$watched [private] |
*
Definition at line 52 of file WatchedItem.php.
| const WatchedItem::CHECK_USER_RIGHTS = 1 |
Constant to specify that user rights 'editmywatchlist' and 'viewmywatchlist' should be checked.
Definition at line 42 of file WatchedItem.php.
| const WatchedItem::IGNORE_USER_RIGHTS = 0 |
Constant to specify that user rights 'editmywatchlist' and 'viewmywatchlist' should not be checked.
Definition at line 35 of file WatchedItem.php.
Referenced by WatchAction\doWatch(), WatchAction\doWatchOrUnwatch(), RollbackAction\onView(), and UploadBase\performUpload().