[ Index ]

PHP Cross Reference of MediaWiki-1.24.0

title

Body

[close]

/includes/ -> WatchedItem.php (summary)

Accessor and mutator for watchlist entries. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

File Size: 435 lines (12 kb)
Included or required:0 times
Referenced: 1 time
Includes or requires: 0 files

Defines 1 class

WatchedItem:: (16 methods):
  fromUserTitle()
  getTitle()
  getTitleNs()
  getTitleDBkey()
  getUserId()
  dbCond()
  load()
  isAllowed()
  isWatched()
  getNotificationTimestamp()
  resetNotificationTimestamp()
  batchAddWatch()
  addWatch()
  removeWatch()
  duplicateEntries()
  doDuplicateEntries()


Class: WatchedItem  - X-Ref

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

fromUserTitle( $user, $title,$checkRights = WatchedItem::CHECK_USER_RIGHTS)   X-Ref
Create a WatchedItem object with the given user and title

param: User $user The user to use for (un)watching
param: Title $title The title we're going to (un)watch
param: int $checkRights Whether to check the 'viewmywatchlist' and 'editmywatchlist' rights.
return: WatchedItem

getTitle()   X-Ref
Title being watched

return: Title

getTitleNs()   X-Ref
Helper to retrieve the title namespace

return: int

getTitleDBkey()   X-Ref
Helper to retrieve the title DBkey

return: string

getUserId()   X-Ref
Helper to retrieve the user id

return: int

dbCond()   X-Ref
Return an array of conditions to select or update the appropriate database
row.

return: array

load()   X-Ref
Load the object from the database


isAllowed( $what )   X-Ref
Check permissions

param: string $what 'viewmywatchlist' or 'editmywatchlist'
return: bool

isWatched()   X-Ref
Is mTitle being watched by mUser?

return: bool

getNotificationTimestamp()   X-Ref
Get the notification timestamp of this entry.

return: bool|null|string False if the page is not watched, the value of

resetNotificationTimestamp( $force = '', $oldid = 0 )   X-Ref
Reset the notification timestamp of this entry

param: bool $force Whether to force the write query to be executed even if the
param: int $oldid The revision id being viewed. If not given or 0, latest revision is assumed.

batchAddWatch( array $items )   X-Ref

param: WatchedItem[] $items
return: bool

addWatch()   X-Ref
Given a title and user (assumes the object is setup), add the watch to the database.

return: bool

removeWatch()   X-Ref
Same as addWatch, only the opposite.

return: bool

duplicateEntries( $ot, $nt )   X-Ref
Check if the given title already is watched by the user, and if so
add watches on a new title. To be used for page renames and such.

param: Title $ot Page title to duplicate entries from, if present
param: Title $nt Page title to add watches on

doDuplicateEntries( $ot, $nt )   X-Ref
Handle duplicate entries. Backend for duplicateEntries().

param: Title $ot
param: Title $nt
return: bool



Generated: Fri Nov 28 14:03:12 2014 Cross-referenced by PHPXref 0.7.1