MediaWiki REL1_32
|
Public Member Functions | |
__construct (Title $pageTitle, Revision $revision=null) | |
checkTemplateLinks () | |
Determines the number of template links for recursive link updates. | |
overrideNewForCategorizationCallback (callable $callback) | |
Overrides the default new for categorization callback This is intended for use while testing and will fail if MW_PHPUNIT_TEST is not defined. | |
triggerCategoryAddedNotification (Title $categoryTitle) | |
Create a recentchanges entry for category additions. | |
triggerCategoryRemovedNotification (Title $categoryTitle) | |
Create a recentchanges entry for category removals. | |
Public Attributes | |
const | CATEGORY_ADDITION = 1 |
const | CATEGORY_REMOVAL = -1 |
Private Member Functions | |
createRecentChangesEntry (Title $categoryTitle, $type) | |
Create a recentchanges entry using RecentChange::notifyCategorization() | |
getChangeMessageText ( $type, $prefixedText, $numTemplateLinks) | |
Returns the change message according to the type of category membership change. | |
getPreviousRevisionTimestamp () | |
Returns the timestamp of the page's previous revision or null if the latest revision does not refer to a parent revision. | |
getUser () | |
Get the user associated with this change. | |
notifyCategorization ( $timestamp, Title $categoryTitle, User $user=null, $comment, Title $pageTitle, $lastTimestamp, $revision, $added) | |
Private Attributes | |
callable null | $newForCategorizationCallback = null |
int | $numTemplateLinks = 0 |
Number of pages this WikiPage is embedded by Set by CategoryMembershipChange::checkTemplateLinks() | |
Title | $pageTitle |
Title instance of the categorized page. | |
Revision null | $revision |
Latest Revision instance of the categorized page. | |
string | $timestamp |
Current timestamp, set during CategoryMembershipChange::__construct() | |
Definition at line 26 of file CategoryMembershipChange.php.
Title | $pageTitle | Title instance of the categorized page |
Revision | null | $revision | Latest Revision instance of the categorized page |
MWException |
Definition at line 64 of file CategoryMembershipChange.php.
References $pageTitle, $revision, Revision\getTimestamp(), revision, and wfTimestampNow().
CategoryMembershipChange::checkTemplateLinks | ( | ) |
Determines the number of template links for recursive link updates.
Definition at line 94 of file CategoryMembershipChange.php.
|
private |
Create a recentchanges entry using RecentChange::notifyCategorization()
Title | $categoryTitle | |
int | $type |
Definition at line 122 of file CategoryMembershipChange.php.
References $type, getChangeMessageText(), getUser(), and notifyCategorization().
Referenced by triggerCategoryAddedNotification(), and triggerCategoryRemovedNotification().
|
private |
Returns the change message according to the type of category membership change.
The message keys created in this method may be one of:
int | $type | may be CategoryMembershipChange::CATEGORY_ADDITION or CategoryMembershipChange::CATEGORY_REMOVAL |
string | $prefixedText | result of Title::->getPrefixedText() |
int | $numTemplateLinks |
Definition at line 251 of file CategoryMembershipChange.php.
References $numTemplateLinks, $type, and wfMessage().
Referenced by createRecentChangesEntry().
|
private |
Returns the timestamp of the page's previous revision or null if the latest revision does not refer to a parent revision.
Definition at line 272 of file CategoryMembershipChange.php.
References Revision\newFromId().
|
private |
Get the user associated with this change.
If there is no revision associated with the change and thus no editing user fallback to a default.
False will be returned if the user name specified in the 'autochange-username' message is invalid.
Definition at line 215 of file CategoryMembershipChange.php.
References $user, $username, User\newFromId(), User\newFromName(), Revision\RAW, revision, and wfMessage().
Referenced by createRecentChangesEntry().
|
private |
string | $timestamp | Timestamp of the recent change to occur in TS_MW format |
Title | $categoryTitle | Title of the category a page is being added to or removed from |
User | null | $user | User object of the user that made the change |
string | $comment | Change summary |
Title | $pageTitle | Title of the page that is being added or removed |
string | $lastTimestamp | Parent revision timestamp of this change in TS_MW format |
Revision | null | $revision | |
bool | $added | true, if the category was added, false for removed |
MWException |
Definition at line 151 of file CategoryMembershipChange.php.
References $newForCategorizationCallback, $pageTitle, $revision, $timestamp, $user, Revision\getId(), Revision\getVisibility(), revision, and Revision\SUPPRESSED_USER.
Referenced by createRecentChangesEntry().
CategoryMembershipChange::overrideNewForCategorizationCallback | ( | callable | $callback | ) |
Overrides the default new for categorization callback This is intended for use while testing and will fail if MW_PHPUNIT_TEST is not defined.
callable | $callback |
MWException |
Definition at line 84 of file CategoryMembershipChange.php.
CategoryMembershipChange::triggerCategoryAddedNotification | ( | Title | $categoryTitle | ) |
Create a recentchanges entry for category additions.
Title | $categoryTitle |
Definition at line 103 of file CategoryMembershipChange.php.
References createRecentChangesEntry().
CategoryMembershipChange::triggerCategoryRemovedNotification | ( | Title | $categoryTitle | ) |
Create a recentchanges entry for category removals.
Title | $categoryTitle |
Definition at line 112 of file CategoryMembershipChange.php.
References createRecentChangesEntry().
|
private |
Definition at line 56 of file CategoryMembershipChange.php.
Referenced by notifyCategorization().
|
private |
Number of pages this WikiPage is embedded by Set by CategoryMembershipChange::checkTemplateLinks()
Definition at line 51 of file CategoryMembershipChange.php.
Referenced by getChangeMessageText().
|
private |
Title instance of the categorized page.
Definition at line 39 of file CategoryMembershipChange.php.
Referenced by __construct(), and notifyCategorization().
|
private |
Latest Revision instance of the categorized page.
Definition at line 44 of file CategoryMembershipChange.php.
Referenced by __construct(), and notifyCategorization().
|
private |
Current timestamp, set during CategoryMembershipChange::__construct()
Definition at line 34 of file CategoryMembershipChange.php.
Referenced by notifyCategorization().
const CategoryMembershipChange::CATEGORY_ADDITION = 1 |
Definition at line 28 of file CategoryMembershipChange.php.
const CategoryMembershipChange::CATEGORY_REMOVAL = -1 |
Definition at line 29 of file CategoryMembershipChange.php.