MediaWiki master
MediaWiki\Page\Event\PageHistoryVisibilityChangedEvent Class Reference

Domain event representing a change to the visibility attributes of one of the page's revisions. More...

Inherits MediaWiki\Page\Event\PageEvent.

Collaboration diagram for MediaWiki\Page\Event\PageHistoryVisibilityChangedEvent:

Public Member Functions

 __construct (ProperPageIdentity $page, UserIdentity $performer, int $currentRevisionId, int $bitsSet, int $bitsUnset, array $visibilityChangeMap, string $reason, array $tags, array $flags, string|ConvertibleTimestamp|false $timestamp)
 
 getAffectedRevisionIDs ()
 
 getBitsSet ()
 Returns the bits that were set by the change.
 
 getBitsUnset ()
 Returns the bits that were unset by the change.
 
 getCurrentRevisionId ()
 Returns the current revision ID of the page at the time of the visibilty change event.
 
 getCurrentRevisionVisibilityAfter ()
 
 getCurrentRevisionVisibilityBefore ()
 
 getPage ()
 
 getReason ()
 
 getVisibilityAfter (int $revId)
 
 getVisibilityBefore (int $revId)
 
 isSuppressed ()
 Whether the log entry for the visibility change was suppressed, because the RevisionRecord::DELETED_RESTRICTED flag was present in the old or the new visibility bitmap of any of the affected revisions.
 
 wasCurrentRevisionAffected ()
 
- Public Member Functions inherited from MediaWiki\Page\Event\PageEvent
 __construct (string $cause, int $pageId, UserIdentity $performer, array $tags=[], array $flags=[], $timestamp=false)
 
 getCause ()
 Indicates the cause of the update.
 
 getPageId ()
 Returns the ID of the page affected by the change.
 
 getPerformer ()
 Returns the user that performed the update.
 
 getTags ()
 Returns any tags applied to the edit.
 
 hasCause (string $cause)
 Checks whether the update had the given cause.
 
 hasTag (string $name)
 Checks for a tag associated the page update.
 
- Public Member Functions inherited from MediaWiki\DomainEvent\DomainEvent
 __construct ( $timestamp=false, bool $isReconciliationRequest=false)
 
 getEventTimestamp ()
 Returns the time at which the event was emitted.
 
 getEventType ()
 Returns this event's type.
 
 getEventTypeChain ()
 Returns the event types this event is compatible with.
 
 isReconciliationRequest ()
 Determines whether this is a reconciliation event, triggered artificially in order to give listeners an opportunity to catch up on missed events or recreate corrupted data.
 

Public Attributes

const FLAG_SUPPRESSED = 'suppressed'
 
const TYPE = 'PageHistoryVisibilityChanged'
 
- Public Attributes inherited from MediaWiki\Page\Event\PageEvent
const TYPE = 'Page'
 
- Public Attributes inherited from MediaWiki\DomainEvent\DomainEvent
const ANY = '*'
 

Additional Inherited Members

- Protected Member Functions inherited from MediaWiki\Page\Event\PageEvent
 hasFlag (string $name)
 Checks flags describing the page update.
 
- Protected Member Functions inherited from MediaWiki\DomainEvent\DomainEvent
 declareEventType (string $eventType)
 Declares the event type.
 

Detailed Description

Domain event representing a change to the visibility attributes of one of the page's revisions.

This does not cover changes to archived revisions.

Since
1.45

Definition at line 20 of file PageHistoryVisibilityChangedEvent.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Page\Event\PageHistoryVisibilityChangedEvent::__construct ( ProperPageIdentity $page,
UserIdentity $performer,
int $currentRevisionId,
int $bitsSet,
int $bitsUnset,
array $visibilityChangeMap,
string $reason,
array $tags,
array $flags,
string|ConvertibleTimestamp|false $timestamp )
Parameters
ProperPageIdentity$pageThe page affected by the update.
UserIdentity$performerThe user performing the update.
int$currentRevisionIdThe current rev id at the time of the visibility change event.
int$bitsSetBitmap indicating which bits got set by the change
int$bitsUnsetBitmap indicating which bits got unset by the change
array<int,array>$visibilityChangeMap a map from revision IDs to visibility changes, in the form [id => ['oldBits' => $oldBits, 'newBits' => $newBits], ... ].
string$reason
array<string>$tags Applicable tags, see ChangeTags.
array<string,bool>$flags See the self::FLAG_XXX constants.
string | ConvertibleTimestamp | false$timestamp

Definition at line 47 of file PageHistoryVisibilityChangedEvent.php.

References MediaWiki\DomainEvent\DomainEvent\declareEventType(), and MediaWiki\Page\ProperPageIdentity\getId().

Member Function Documentation

◆ getAffectedRevisionIDs()

MediaWiki\Page\Event\PageHistoryVisibilityChangedEvent::getAffectedRevisionIDs ( )
Returns
int[]

Definition at line 118 of file PageHistoryVisibilityChangedEvent.php.

◆ getBitsSet()

MediaWiki\Page\Event\PageHistoryVisibilityChangedEvent::getBitsSet ( )

Returns the bits that were set by the change.

Returns
int

Definition at line 82 of file PageHistoryVisibilityChangedEvent.php.

◆ getBitsUnset()

MediaWiki\Page\Event\PageHistoryVisibilityChangedEvent::getBitsUnset ( )

Returns the bits that were unset by the change.

Returns
int

Definition at line 90 of file PageHistoryVisibilityChangedEvent.php.

◆ getCurrentRevisionId()

MediaWiki\Page\Event\PageHistoryVisibilityChangedEvent::getCurrentRevisionId ( )

Returns the current revision ID of the page at the time of the visibilty change event.

Returns
int

Definition at line 135 of file PageHistoryVisibilityChangedEvent.php.

◆ getCurrentRevisionVisibilityAfter()

MediaWiki\Page\Event\PageHistoryVisibilityChangedEvent::getCurrentRevisionVisibilityAfter ( )

Definition at line 143 of file PageHistoryVisibilityChangedEvent.php.

◆ getCurrentRevisionVisibilityBefore()

MediaWiki\Page\Event\PageHistoryVisibilityChangedEvent::getCurrentRevisionVisibilityBefore ( )

Definition at line 139 of file PageHistoryVisibilityChangedEvent.php.

◆ getPage()

MediaWiki\Page\Event\PageHistoryVisibilityChangedEvent::getPage ( )

Definition at line 107 of file PageHistoryVisibilityChangedEvent.php.

◆ getReason()

MediaWiki\Page\Event\PageHistoryVisibilityChangedEvent::getReason ( )

Definition at line 111 of file PageHistoryVisibilityChangedEvent.php.

◆ getVisibilityAfter()

MediaWiki\Page\Event\PageHistoryVisibilityChangedEvent::getVisibilityAfter ( int $revId)

Definition at line 155 of file PageHistoryVisibilityChangedEvent.php.

◆ getVisibilityBefore()

MediaWiki\Page\Event\PageHistoryVisibilityChangedEvent::getVisibilityBefore ( int $revId)

Definition at line 147 of file PageHistoryVisibilityChangedEvent.php.

◆ isSuppressed()

MediaWiki\Page\Event\PageHistoryVisibilityChangedEvent::isSuppressed ( )

Whether the log entry for the visibility change was suppressed, because the RevisionRecord::DELETED_RESTRICTED flag was present in the old or the new visibility bitmap of any of the affected revisions.

Note
Listeners should use this information to protect information from suppressed deletions from access by unauthorized users.

Definition at line 103 of file PageHistoryVisibilityChangedEvent.php.

◆ wasCurrentRevisionAffected()

MediaWiki\Page\Event\PageHistoryVisibilityChangedEvent::wasCurrentRevisionAffected ( )
Returns
bool

Definition at line 125 of file PageHistoryVisibilityChangedEvent.php.

Member Data Documentation

◆ FLAG_SUPPRESSED

const MediaWiki\Page\Event\PageHistoryVisibilityChangedEvent::FLAG_SUPPRESSED = 'suppressed'

◆ TYPE

const MediaWiki\Page\Event\PageHistoryVisibilityChangedEvent::TYPE = 'PageHistoryVisibilityChanged'

Definition at line 22 of file PageHistoryVisibilityChangedEvent.php.


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