|
MediaWiki REL1_39
|
Class for creating new log entries and inserting them into the database. More...


Public Member Functions | |
| __construct ( $type, $subtype) | |
| addTags ( $tags) | |
| Add change tags for the log entry. | |
| getAssociatedRevId () | |
| getComment () | |
| getDeleted () | |
| getIsPatrollable () | |
| Whether this log entry is patrollable. | |
| getParameters () | |
| getPerformerIdentity () | |
| getRecentChange ( $newId=0) | |
| Get a RecentChanges object for the log entry. | |
| getSubtype () | |
| getTags () | |
| getTarget () | |
| getTimestamp () | |
| getType () | |
| insert (IDatabase $dbw=null) | |
Insert the entry into the logging table. | |
| isLegacy () | |
| publish ( $newId, $to='rcandudp') | |
| Publish the log entry. | |
| setAssociatedRevId ( $revId) | |
| Set an associated revision id. | |
| setComment (string $comment) | |
| Set a comment associated with the action being logged. | |
| setDeleted ( $deleted) | |
| Set the 'deleted' flag. | |
| setForceBotFlag (bool $forceBotFlag) | |
| Set the bot flag in the recent changes to this value. | |
| setIsPatrollable ( $patrollable) | |
| Set whether this log entry should be made patrollable This shouldn't depend on config, only on whether there is full support in the software for patrolling this log entry. | |
| setLegacy ( $legacy) | |
| Set the 'legacy' flag. | |
| setParameters ( $parameters) | |
| Set extra log parameters. | |
| setPerformer (UserIdentity $performer) | |
| Set the user that performed the action being logged. | |
| setRelations (array $relations) | |
| Declare arbitrary tag/value relations to this log entry. | |
| setTags ( $tags) | |
| Set change tags for the log entry. | |
| setTarget ( $target) | |
| Set the title of the object changed. | |
| setTimestamp ( $timestamp) | |
| Set the timestamp of when the logged action took place. | |
Public Member Functions inherited from LogEntryBase | |
| getFullType () | |
| The full logtype in format maintype/subtype. | |
| isDeleted ( $field) | |
Protected Attributes | |
| string | $comment = '' |
| Comment for the log entry. | |
| int | $deleted |
| Deletion state of the log entry. | |
| bool null | $forceBotFlag = null |
| The bot flag in the recent changes will be set to this value. | |
| int | $id |
| ID of the log entry. | |
| bool | $isPatrollable = false |
| Can this log entry be patrolled? | |
| bool | $legacy = false |
| Whether this is a legacy log entry. | |
| array | $parameters = [] |
| Parameters for log entry. | |
| UserIdentity | $performer |
| Performer of the action for the log entry. | |
| array | $relations = [] |
| int | $revId = 0 |
| A rev id associated to the log entry. | |
| string | $subtype |
| Sub type of log entry. | |
| string[] | $tags = [] |
| Change tags add to the log entry. | |
| Title | $target |
| Target title for the log entry. | |
| string | $timestamp |
| Timestamp of creation of the log entry. | |
| string | $type |
| Type of log entry. | |
Additional Inherited Members | |
Static Public Member Functions inherited from LogEntryBase | |
| static | extractParams ( $blob) |
| Extract a parameter array from a blob. | |
| static | makeParamBlob ( $params) |
| Create a blob from a parameter array. | |
Class for creating new log entries and inserting them into the database.
Definition at line 45 of file ManualLogEntry.php.
| ManualLogEntry::__construct | ( | $type, | |
| $subtype ) |
| string | $type | Log type. Should match $wgLogTypes. |
| string | $subtype | Log subtype (action). Should match $wgLogActions or (together with $type) $wgLogActionsHandlers. |
Definition at line 99 of file ManualLogEntry.php.
References $type.
| ManualLogEntry::addTags | ( | $tags | ) |
Add change tags for the log entry.
| string | string[] | null | $tags | Tags to apply |
Implements MediaWiki\ChangeTags\Taggable.
Definition at line 236 of file ManualLogEntry.php.
Referenced by setTags().
| ManualLogEntry::getAssociatedRevId | ( | ) |
| ManualLogEntry::getComment | ( | ) |
| ManualLogEntry::getDeleted | ( | ) |
| ManualLogEntry::getIsPatrollable | ( | ) |
Whether this log entry is patrollable.
Definition at line 537 of file ManualLogEntry.php.
| ManualLogEntry::getParameters | ( | ) |
| ManualLogEntry::getPerformerIdentity | ( | ) |
| ManualLogEntry::getRecentChange | ( | $newId = 0 | ) |
Get a RecentChanges object for the log entry.
| int | $newId |
Definition at line 371 of file ManualLogEntry.php.
References getTimestamp(), SpecialPage\getTitleFor(), and LogEntryBase\makeParamBlob().
| ManualLogEntry::getSubtype | ( | ) |
| ManualLogEntry::getTags | ( | ) |
| ManualLogEntry::getTarget | ( | ) |
| ManualLogEntry::getTimestamp | ( | ) |
Implements LogEntry.
Definition at line 502 of file ManualLogEntry.php.
References wfTimestamp(), and wfTimestampNow().
| ManualLogEntry::getType | ( | ) |
Implements LogEntry.
Definition at line 467 of file ManualLogEntry.php.
References $type.
| ManualLogEntry::insert | ( | IDatabase | $dbw = null | ) |
Insert the entry into the logging table.
| IDatabase | null | $dbw |
| MWException |
Definition at line 298 of file ManualLogEntry.php.
References DB_PRIMARY, getTimestamp(), LogEntryBase\makeParamBlob(), wfGetDB(), and wfTimestampNow().
| ManualLogEntry::isLegacy | ( | ) |
Reimplemented from LogEntryBase.
Definition at line 545 of file ManualLogEntry.php.
| ManualLogEntry::publish | ( | $newId, | |
| $to = 'rcandudp' ) |
Publish the log entry.
| int | $newId | Id of the log entry. |
| string | $to | One of: rcandudp (default), rc, udp |
Definition at line 413 of file ManualLogEntry.php.
References ChangeTags\addTags(), DB_PRIMARY, and wfGetDB().
| ManualLogEntry::setAssociatedRevId | ( | $revId | ) |
Set an associated revision id.
For example, the ID of the revision that was inserted to mark a page move or protection, file upload, etc.
| int | $revId |
Definition at line 206 of file ManualLogEntry.php.
| ManualLogEntry::setComment | ( | string | $comment | ) |
Set a comment associated with the action being logged.
| string | $comment |
Definition at line 193 of file ManualLogEntry.php.
| ManualLogEntry::setDeleted | ( | $deleted | ) |
Set the 'deleted' flag.
| int | $deleted | One of LogPage::DELETED_* bitfield constants |
Definition at line 277 of file ManualLogEntry.php.
| ManualLogEntry::setForceBotFlag | ( | bool | $forceBotFlag | ) |
Set the bot flag in the recent changes to this value.
| bool | $forceBotFlag |
Definition at line 287 of file ManualLogEntry.php.
| ManualLogEntry::setIsPatrollable | ( | $patrollable | ) |
Set whether this log entry should be made patrollable This shouldn't depend on config, only on whether there is full support in the software for patrolling this log entry.
False by default
| bool | $patrollable |
Definition at line 257 of file ManualLogEntry.php.
| ManualLogEntry::setLegacy | ( | $legacy | ) |
Set the 'legacy' flag.
| bool | $legacy |
Definition at line 267 of file ManualLogEntry.php.
| ManualLogEntry::setParameters | ( | $parameters | ) |
Set extra log parameters.
You can pass params to the log action message by prefixing the keys with a number and optional type, using colons to separate the fields. The numbering should start with number 4 (matching the $4 message parameter), the first three parameters are hardcoded for every message ($1 is a link to the username and user talk page of the performing user, $2 is just the username (for determining gender), $3 is a link to the target page).
Typically, these parameters will be used in the logentry-<type>-<subtype> message, but custom formatters, declared via $wgLogActionsHandlers, can override that.
If you want to store stuff that should not be available in messages, don't prefix the array key with a number and don't use the colons. Parameters which should be searchable need to be set with setRelations() instead.
Example: $entry->setParameters( '4::color' => 'blue', '5:number:count' => 3000, 'animal' => 'dog' );
| array | $parameters | Associative array |
Definition at line 134 of file ManualLogEntry.php.
| ManualLogEntry::setPerformer | ( | UserIdentity | $performer | ) |
Set the user that performed the action being logged.
| UserIdentity | $performer |
Definition at line 155 of file ManualLogEntry.php.
| ManualLogEntry::setRelations | ( | array | $relations | ) |
Declare arbitrary tag/value relations to this log entry.
These can be used to filter log entries later on.
| array | $relations | Map of (tag => (list of values|value)) |
Definition at line 145 of file ManualLogEntry.php.
| ManualLogEntry::setTags | ( | $tags | ) |
Set change tags for the log entry.
Passing null means the same as empty array, for compatibility with WikiPage::doUpdateRestrictions().
| string | string[] | null | $tags |
Definition at line 221 of file ManualLogEntry.php.
References addTags(), wfDebug(), and wfDeprecated().
| ManualLogEntry::setTarget | ( | $target | ) |
Set the title of the object changed.
| LinkTarget | PageReference | $target | calling with LinkTarget is deprecated since 1.37 |
Definition at line 166 of file ManualLogEntry.php.
| ManualLogEntry::setTimestamp | ( | $timestamp | ) |
Set the timestamp of when the logged action took place.
| string | $timestamp |
Definition at line 183 of file ManualLogEntry.php.
|
protected |
Comment for the log entry.
Definition at line 68 of file ManualLogEntry.php.
|
protected |
Deletion state of the log entry.
Definition at line 77 of file ManualLogEntry.php.
|
protected |
The bot flag in the recent changes will be set to this value.
Definition at line 89 of file ManualLogEntry.php.
|
protected |
ID of the log entry.
Definition at line 80 of file ManualLogEntry.php.
|
protected |
Can this log entry be patrolled?
Definition at line 83 of file ManualLogEntry.php.
|
protected |
Whether this is a legacy log entry.
Definition at line 86 of file ManualLogEntry.php.
|
protected |
Parameters for log entry.
Definition at line 53 of file ManualLogEntry.php.
|
protected |
Performer of the action for the log entry.
Definition at line 59 of file ManualLogEntry.php.
|
protected |
Definition at line 56 of file ManualLogEntry.php.
|
protected |
A rev id associated to the log entry.
Definition at line 71 of file ManualLogEntry.php.
|
protected |
Sub type of log entry.
Definition at line 50 of file ManualLogEntry.php.
|
protected |
Change tags add to the log entry.
Definition at line 74 of file ManualLogEntry.php.
|
protected |
Target title for the log entry.
Definition at line 62 of file ManualLogEntry.php.
|
protected |
Timestamp of creation of the log entry.
Definition at line 65 of file ManualLogEntry.php.
|
protected |
Type of log entry.
Definition at line 47 of file ManualLogEntry.php.