MediaWiki  1.27.2
WatchedItem Class Reference

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

Collaboration diagram for WatchedItem:

Public Member Functions

 __construct (User $user, LinkTarget $linkTarget, $notificationTimestamp, $checkRights=null)
 
 addWatch ()
 
 getLinkTarget ()
 
 getNotificationTimestamp ()
 Get the notification timestamp of this entry. More...
 
 getTitle ()
 Back compat pre 1.27 with the WatchedItemStore introduction. More...
 
 getUser ()
 
 isWatched ()
 
 removeWatch ()
 
 resetNotificationTimestamp ($force= '', $oldid=0)
 

Static Public Member Functions

static batchAddWatch (array $items)
 
static duplicateEntries (Title $oldTitle, Title $newTitle)
 
static fromUserTitle ($user, $title, $checkRights=User::CHECK_USER_RIGHTS)
 

Public Attributes

bool $checkRights = User::CHECK_USER_RIGHTS
 
const CHECK_USER_RIGHTS = User::CHECK_USER_RIGHTS
 
const DEPRECATED_USAGE_TIMESTAMP = -100
 
const IGNORE_USER_RIGHTS = User::IGNORE_USER_RIGHTS
 

Private Attributes

LinkTarget $linkTarget
 
null string $notificationTimestamp
 the value of the wl_notificationtimestamp field More...
 
Title $title
 
User $user
 

Detailed Description

Representation of a pair of user and title for watchlist entries.

Author
Tim Starling
Addshore

Definition at line 31 of file WatchedItem.php.

Constructor & Destructor Documentation

WatchedItem::__construct ( User  $user,
LinkTarget  $linkTarget,
  $notificationTimestamp,
  $checkRights = null 
)
Parameters
User$user
LinkTarget$linkTarget
null | string$notificationTimestampthe value of the wl_notificationtimestamp field
bool | null$checkRightsDO NOT USE - used internally for backward compatibility

Definition at line 81 of file WatchedItem.php.

References $checkRights, $linkTarget, $notificationTimestamp, $user, and user.

Member Function Documentation

WatchedItem::addWatch ( )
Deprecated:
since 1.27 Use User::addWatch()
Returns
bool

Definition at line 210 of file WatchedItem.php.

References getTitle(), and user.

static WatchedItem::batchAddWatch ( array  $items)
static
Deprecated:
since 1.27 Use WatchedItemStore::addWatchBatch()

Definition at line 177 of file WatchedItem.php.

References $success, $user, as, WatchedItemStore\getDefaultInstance(), User\getId(), User\getTalkPage(), and User\isAllowed().

Referenced by WatchedItemUnitTest\testBatchAddWatch().

static WatchedItem::duplicateEntries ( Title  $oldTitle,
Title  $newTitle 
)
static
WatchedItem::getLinkTarget ( )
Returns
LinkTarget

Definition at line 105 of file WatchedItem.php.

References $linkTarget.

Referenced by WatchedItemStore\cache().

WatchedItem::getNotificationTimestamp ( )

Get the notification timestamp of this entry.

Returns
bool|null|string

Definition at line 114 of file WatchedItem.php.

References $notificationTimestamp, WatchedItemStore\getDefaultInstance(), and user.

WatchedItem::getTitle ( )

Back compat pre 1.27 with the WatchedItemStore introduction.

Todo:

remove in 1.28/9

Returns
Title
Deprecated:
Internal class use only

Definition at line 142 of file WatchedItem.php.

References $title, Title\newFromLinkTarget(), and title.

Referenced by addWatch(), isWatched(), removeWatch(), and resetNotificationTimestamp().

WatchedItem::getUser ( )
Returns
User

Definition at line 98 of file WatchedItem.php.

References $user.

Referenced by WatchedItemStore\cache().

WatchedItem::isWatched ( )
Deprecated:
since 1.27 Use User::isWatched()
Returns
bool

Definition at line 233 of file WatchedItem.php.

References getTitle(), and user.

WatchedItem::removeWatch ( )
Deprecated:
since 1.27 Use User::removeWatch()
Returns
bool

Definition at line 220 of file WatchedItem.php.

References getTitle(), and user.

WatchedItem::resetNotificationTimestamp (   $force = '',
  $oldid = 0 
)

Member Data Documentation

bool WatchedItem::$checkRights = User::CHECK_USER_RIGHTS
Deprecated:
Internal class use only

Definition at line 52 of file WatchedItem.php.

Referenced by __construct().

LinkTarget WatchedItem::$linkTarget
private

Definition at line 63 of file WatchedItem.php.

Referenced by __construct(), and getLinkTarget().

null string WatchedItem::$notificationTimestamp
private

the value of the wl_notificationtimestamp field

Definition at line 73 of file WatchedItem.php.

Referenced by __construct(), and getNotificationTimestamp().

Title WatchedItem::$title
private
Deprecated:
Internal class use only

Definition at line 58 of file WatchedItem.php.

Referenced by fromUserTitle(), and getTitle().

User WatchedItem::$user
private

Definition at line 68 of file WatchedItem.php.

Referenced by __construct(), batchAddWatch(), fromUserTitle(), and getUser().

const WatchedItem::CHECK_USER_RIGHTS = User::CHECK_USER_RIGHTS
Deprecated:
since 1.27, see User::CHECK_USER_RIGHTS

Definition at line 41 of file WatchedItem.php.

const WatchedItem::DEPRECATED_USAGE_TIMESTAMP = -100
Deprecated:
Internal class use only

Definition at line 46 of file WatchedItem.php.

const WatchedItem::IGNORE_USER_RIGHTS = User::IGNORE_USER_RIGHTS
Deprecated:
since 1.27, see User::IGNORE_USER_RIGHTS

Definition at line 36 of file WatchedItem.php.


The documentation for this class was generated from the following file: