MediaWiki  1.28.0
ManualLogEntry Class Reference

Class for creating log entries manually, to inject them into the database. More...

Inheritance diagram for ManualLogEntry:
Collaboration diagram for ManualLogEntry:

Public Member Functions

 __construct ($type, $subtype)
 Constructor. More...
 
 getAssociatedRevId ()
 
 getComment ()
 Get the user provided comment. More...
 
 getDeleted ()
 Get the access restriction. More...
 
 getIsPatrollable ()
 Whether this log entry is patrollable. More...
 
 getParameters ()
 Get the extra parameters stored for this message. More...
 
 getPerformer ()
 
 getRecentChange ($newId=0)
 Get a RecentChanges object for the log entry. More...
 
 getSubtype ()
 The log subtype. More...
 
 getTags ()
 
 getTarget ()
 
 getTimestamp ()
 Get the timestamp when the action was executed. More...
 
 getType ()
 The main log type. More...
 
 insert (IDatabase $dbw=null)
 Insert the entry into the logging table. More...
 
 isLegacy ()
 
 publish ($newId, $to= 'rcandudp')
 Publish the log entry. More...
 
 setAssociatedRevId ($revId)
 Set an associated revision id. More...
 
 setComment ($comment)
 Set a comment associated with the action being logged. More...
 
 setDeleted ($deleted)
 Set the 'deleted' flag. More...
 
 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. More...
 
 setLegacy ($legacy)
 Set the 'legacy' flag. More...
 
 setParameters ($parameters)
 Set extra log parameters. More...
 
 setPerformer (User $performer)
 Set the user that performed the action being logged. More...
 
 setRelations (array $relations)
 Declare arbitrary tag/value relations to this log entry. More...
 
 setTags ($tags)
 Set change tags for the log entry. More...
 
 setTarget (Title $target)
 Set the title of the object changed. More...
 
 setTimestamp ($timestamp)
 Set the timestamp of when the logged action took place. More...
 
- Public Member Functions inherited from LogEntryBase
 getFullType ()
 The full logtype in format maintype/subtype. More...
 
 isDeleted ($field)
 
 isLegacy ()
 Whether the parameters for this log are stored in new or old format. More...
 

Protected Attributes

string $comment = ''
 Comment for the log entry. More...
 
int $deleted
 Deletion state of the log entry. More...
 
int $id
 ID of the log entry. More...
 
Can $isPatrollable = false
 this log entry be patrolled? More...
 
bool $legacy = false
 Whether this is a legacy log entry. More...
 
array $parameters = []
 Parameters for log entry. More...
 
User $performer
 Performer of the action for the log entry. More...
 
array $relations = []
 
int $revId = 0
 A rev id associated to the log entry. More...
 
string $subtype
 Sub type of log entry. More...
 
array $tags = null
 Change tags add to the log entry. More...
 
Title $target
 Target title for the log entry. More...
 
string $timestamp
 Timestamp of creation of the log entry. More...
 
string $type
 Type of log entry. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from LogEntryBase
static extractParams ($blob)
 Extract a parameter array from a blob. More...
 
static makeParamBlob ($params)
 Create a blob from a parameter array. More...
 

Detailed Description

Class for creating log entries manually, to inject them into the database.

Since
1.19

Definition at line 394 of file LogEntry.php.

Constructor & Destructor Documentation

ManualLogEntry::__construct (   $type,
  $subtype 
)

Constructor.

Since
1.19
Parameters
string$type
string$subtype

Definition at line 444 of file LogEntry.php.

References $subtype, $type, and type.

Member Function Documentation

ManualLogEntry::getAssociatedRevId ( )
Since
1.27
Returns
int

Definition at line 783 of file LogEntry.php.

References $revId.

Referenced by getRecentChange(), and insert().

ManualLogEntry::getComment ( )

Get the user provided comment.

Returns
string

Implements LogEntry.

Definition at line 775 of file LogEntry.php.

References $comment.

Referenced by getRecentChange(), and insert().

ManualLogEntry::getDeleted ( )

Get the access restriction.

Returns
string

Implements LogEntry.

Definition at line 813 of file LogEntry.php.

References $deleted.

ManualLogEntry::getIsPatrollable ( )

Whether this log entry is patrollable.

Since
1.27
Returns
bool

Definition at line 801 of file LogEntry.php.

References $isPatrollable.

Referenced by getRecentChange(), and publish().

ManualLogEntry::getParameters ( )

Get the extra parameters stored for this message.

Returns
array

Implements LogEntry.

Definition at line 751 of file LogEntry.php.

References $parameters.

Referenced by getRecentChange(), and insert().

ManualLogEntry::getPerformer ( )
Returns
User

Implements LogEntry.

Definition at line 758 of file LogEntry.php.

References $performer.

Referenced by getRecentChange(), insert(), and publish().

ManualLogEntry::getRecentChange (   $newId = 0)
ManualLogEntry::getSubtype ( )

The log subtype.

Returns
string

Implements LogEntry.

Definition at line 747 of file LogEntry.php.

References $subtype.

Referenced by getRecentChange(), and insert().

ManualLogEntry::getTags ( )
Since
1.27
Returns
array

Definition at line 791 of file LogEntry.php.

References $tags.

Referenced by publish().

ManualLogEntry::getTarget ( )
Returns
Title

Implements LogEntry.

Definition at line 765 of file LogEntry.php.

References $target.

Referenced by getRecentChange(), and insert().

ManualLogEntry::getTimestamp ( )

Get the timestamp when the action was executed.

Returns
string

Implements LogEntry.

Definition at line 769 of file LogEntry.php.

References TS_MW, wfTimestamp(), and wfTimestampNow().

Referenced by getRecentChange(), and insert().

ManualLogEntry::getType ( )

The main log type.

Returns
string

Implements LogEntry.

Definition at line 743 of file LogEntry.php.

References $type.

Referenced by getRecentChange(), insert(), and publish().

ManualLogEntry::insert ( IDatabase  $dbw = null)

Insert the entry into the logging table.

Parameters
IDatabase$dbw
Returns
int ID of the log entry
Exceptions
MWException

Definition at line 591 of file LogEntry.php.

References $comment, $deleted, $id, $params, $relations, $revId, $tag, $value, $wgContLang, as, DB_MASTER, getAssociatedRevId(), getComment(), getParameters(), getPerformer(), getSubtype(), getTarget(), getTimestamp(), getType(), global, LogEntryBase\makeParamBlob(), wfGetDB(), and wfTimestampNow().

ManualLogEntry::isLegacy ( )
Since
1.25
Returns
bool

Definition at line 809 of file LogEntry.php.

References $legacy.

ManualLogEntry::publish (   $newId,
  $to = 'rcandudp' 
)

Publish the log entry.

Parameters
int$newIdId of the log entry.
string$toOne of: rcandudp (default), rc, udp

Definition at line 709 of file LogEntry.php.

References DeferredUpdates\addCallableUpdate(), DB_MASTER, getIsPatrollable(), getPerformer(), getRecentChange(), getTags(), getType(), DeferredUpdates\POSTSEND, PatrolLog\record(), use, 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.

Since
1.27
Parameters
int$revId

Definition at line 534 of file LogEntry.php.

References $revId.

ManualLogEntry::setComment (   $comment)

Set a comment associated with the action being logged.

Since
1.19
Parameters
string$comment

Definition at line 521 of file LogEntry.php.

References $comment, and comment.

ManualLogEntry::setDeleted (   $deleted)

Set the 'deleted' flag.

Since
1.19
Parameters
int$deletedOne of LogPage::DELETED_* bitfield constants

Definition at line 580 of file LogEntry.php.

References $deleted.

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

Since
1.27
Parameters
bool$patrollable

Definition at line 560 of file LogEntry.php.

ManualLogEntry::setLegacy (   $legacy)

Set the 'legacy' flag.

Since
1.25
Parameters
bool$legacy

Definition at line 570 of file LogEntry.php.

References $legacy.

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, the first three parameters are hardcoded for every message.

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.

Example: $entry->setParameters( '4color' => 'blue', '5:number:count' => 3000, 'animal' => 'dog' );

Since
1.19
Parameters
array$parametersAssociative array

Definition at line 470 of file LogEntry.php.

References $parameters.

ManualLogEntry::setPerformer ( User  $performer)

Set the user that performed the action being logged.

Since
1.19
Parameters
User$performer

Definition at line 491 of file LogEntry.php.

References $performer.

ManualLogEntry::setRelations ( array  $relations)

Declare arbitrary tag/value relations to this log entry.

These can be used to filter log entries later on.

Parameters
array$relationsMap of (tag => (list of values|value))
Since
1.22

Definition at line 481 of file LogEntry.php.

References $relations.

ManualLogEntry::setTags (   $tags)

Set change tags for the log entry.

Since
1.27
Parameters
string|string[]$tags

Definition at line 544 of file LogEntry.php.

References $tags.

ManualLogEntry::setTarget ( Title  $target)

Set the title of the object changed.

Since
1.19
Parameters
Title$target

Definition at line 501 of file LogEntry.php.

References $target.

ManualLogEntry::setTimestamp (   $timestamp)

Set the timestamp of when the logged action took place.

Since
1.19
Parameters
string$timestamp

Definition at line 511 of file LogEntry.php.

References $timestamp.

Member Data Documentation

string ManualLogEntry::$comment = ''
protected

Comment for the log entry.

Definition at line 417 of file LogEntry.php.

Referenced by getComment(), insert(), and setComment().

int ManualLogEntry::$deleted
protected

Deletion state of the log entry.

Definition at line 426 of file LogEntry.php.

Referenced by getDeleted(), insert(), and setDeleted().

int ManualLogEntry::$id
protected

ID of the log entry.

Definition at line 429 of file LogEntry.php.

Referenced by insert().

Can ManualLogEntry::$isPatrollable = false
protected

this log entry be patrolled?

Definition at line 432 of file LogEntry.php.

Referenced by getIsPatrollable().

bool ManualLogEntry::$legacy = false
protected

Whether this is a legacy log entry.

Definition at line 435 of file LogEntry.php.

Referenced by isLegacy(), and setLegacy().

array ManualLogEntry::$parameters = []
protected

Parameters for log entry.

Definition at line 402 of file LogEntry.php.

Referenced by getParameters(), and setParameters().

User ManualLogEntry::$performer
protected

Performer of the action for the log entry.

Definition at line 408 of file LogEntry.php.

Referenced by getPerformer(), and setPerformer().

array ManualLogEntry::$relations = []
protected

Definition at line 405 of file LogEntry.php.

Referenced by insert(), and setRelations().

int ManualLogEntry::$revId = 0
protected

A rev id associated to the log entry.

Definition at line 420 of file LogEntry.php.

Referenced by getAssociatedRevId(), insert(), and setAssociatedRevId().

string ManualLogEntry::$subtype
protected

Sub type of log entry.

Definition at line 399 of file LogEntry.php.

Referenced by __construct(), and getSubtype().

array ManualLogEntry::$tags = null
protected

Change tags add to the log entry.

Definition at line 423 of file LogEntry.php.

Referenced by getTags(), and setTags().

Title ManualLogEntry::$target
protected

Target title for the log entry.

Definition at line 411 of file LogEntry.php.

Referenced by getTarget(), and setTarget().

string ManualLogEntry::$timestamp
protected

Timestamp of creation of the log entry.

Definition at line 414 of file LogEntry.php.

Referenced by setTimestamp().

string ManualLogEntry::$type
protected

Type of log entry.

Definition at line 396 of file LogEntry.php.

Referenced by __construct(), and getType().


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