MediaWiki  1.23.3
ManualLogEntry Class Reference

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

Inheritance diagram for ManualLogEntry:
Collaboration diagram for ManualLogEntry:

Public Member Functions

 __construct ( $type, $subtype)
 Constructor. More...
 
 getComment ()
 Get the user provided comment. More...
 
 getDeleted ()
 Get the access restriction. 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...
 
 getTarget ()
 
 getTimestamp ()
 Get the timestamp when the action was executed. More...
 
 getType ()
 The main log type. More...
 
 insert (IDatabase $dbw=null)
 Inserts the entry into the logging table. More...
 
 publish ( $newId, $to='rcandudp')
 Publishes the log entry. More...
 
 setComment ( $comment)
 Set a comment associated with the action being logged. More...
 
 setDeleted ( $deleted)
 TODO: document. 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...
 
 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...
 
array $parameters = array()
 Parameters for log entry *. More...
 
User $performer
 Performer of the action for the log entry *. More...
 
array $relations = array()
 
string $subtype
 Sub type of 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...
 

Detailed Description

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

Since
1.19

Definition at line 339 of file LogEntry.php.

Constructor & Destructor Documentation

◆ __construct()

ManualLogEntry::__construct (   $type,
  $subtype 
)

Constructor.

Since
1.19
Parameters
string$type
string$subtype

Definition at line 368 of file LogEntry.php.

References $subtype, $type, and type.

Member Function Documentation

◆ getComment()

ManualLogEntry::getComment ( )

Get the user provided comment.

Returns
string

Implements LogEntry.

Definition at line 613 of file LogEntry.php.

References $comment.

Referenced by getRecentChange(), and insert().

◆ getDeleted()

ManualLogEntry::getDeleted ( )

Get the access restriction.

Returns
string

Implements LogEntry.

Definition at line 617 of file LogEntry.php.

References $deleted.

◆ getParameters()

ManualLogEntry::getParameters ( )

Get the extra parameters stored for this message.

Returns
array

Implements LogEntry.

Definition at line 589 of file LogEntry.php.

References $parameters.

Referenced by getRecentChange(), and insert().

◆ getPerformer()

ManualLogEntry::getPerformer ( )
Returns
User

Implements LogEntry.

Definition at line 596 of file LogEntry.php.

References $performer.

Referenced by getRecentChange(), and insert().

◆ getRecentChange()

ManualLogEntry::getRecentChange (   $newId = 0)

◆ getSubtype()

ManualLogEntry::getSubtype ( )

The log subtype.

Returns
string

Implements LogEntry.

Definition at line 585 of file LogEntry.php.

References $subtype.

Referenced by getRecentChange(), and insert().

◆ getTarget()

ManualLogEntry::getTarget ( )
Returns
Title

Implements LogEntry.

Definition at line 603 of file LogEntry.php.

References $target.

Referenced by getRecentChange(), and insert().

◆ getTimestamp()

ManualLogEntry::getTimestamp ( )

Get the timestamp when the action was executed.

Returns
string

Implements LogEntry.

Definition at line 607 of file LogEntry.php.

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

Referenced by getRecentChange().

◆ getType()

ManualLogEntry::getType ( )

The main log type.

Returns
string

Implements LogEntry.

Definition at line 581 of file LogEntry.php.

References $type.

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

◆ insert()

ManualLogEntry::insert ( IDatabase  $dbw = null)

Inserts the entry into the logging table.

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

Definition at line 465 of file LogEntry.php.

References $comment, $id, $value, $wgContLang, array(), as, DB_MASTER, getComment(), getParameters(), getPerformer(), getSubtype(), getTarget(), getType(), global, wfGetDB(), and wfTimestampNow().

◆ publish()

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

Publishes the log entry.

Parameters
int$newIdid of the log entry.
string$torcandudp (default), rc, udp

Definition at line 562 of file LogEntry.php.

References getRecentChange(), and getType().

◆ setComment()

ManualLogEntry::setComment (   $comment)

Set a comment associated with the action being logged.

Since
1.19
Parameters
string$comment

Definition at line 444 of file LogEntry.php.

References $comment.

◆ setDeleted()

ManualLogEntry::setDeleted (   $deleted)

TODO: document.

Since
1.19
Parameters
integer$deleted

Definition at line 455 of file LogEntry.php.

References $deleted.

◆ setParameters()

ManualLogEntry::setParameters (   $parameters)

Set extra log parameters.

You can pass params to the log action message by prefixing the keys with a number and colon. The numbering should start with number 4, the first three parameters are hardcoded for every message. Example: $entry->setParameters( '4:color' => 'blue', 'animal' => 'dog' );

Since
1.19
Parameters
array$parametersAssociative array

Definition at line 389 of file LogEntry.php.

References $parameters.

◆ setPerformer()

ManualLogEntry::setPerformer ( User  $performer)

Set the user that performed the action being logged.

Since
1.19
Parameters
User$performer

Definition at line 411 of file LogEntry.php.

References $performer.

◆ setRelations()

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))
Since
1.22

Definition at line 400 of file LogEntry.php.

References $relations.

◆ setTarget()

ManualLogEntry::setTarget ( Title  $target)

Set the title of the object changed.

Since
1.19
Parameters
Title$target

Definition at line 422 of file LogEntry.php.

References $target.

◆ setTimestamp()

ManualLogEntry::setTimestamp (   $timestamp)

Set the timestamp of when the logged action took place.

Since
1.19
Parameters
string$timestamp

Definition at line 433 of file LogEntry.php.

References $timestamp.

Member Data Documentation

◆ $comment

string ManualLogEntry::$comment = ''
protected

Comment for the log entry *.

Definition at line 354 of file LogEntry.php.

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

◆ $deleted

int ManualLogEntry::$deleted
protected

Deletion state of the log entry *.

Definition at line 356 of file LogEntry.php.

Referenced by getDeleted(), and setDeleted().

◆ $id

int ManualLogEntry::$id
protected

ID of the log entry *.

Definition at line 358 of file LogEntry.php.

Referenced by insert().

◆ $parameters

array ManualLogEntry::$parameters = array()
protected

Parameters for log entry *.

Definition at line 344 of file LogEntry.php.

Referenced by getParameters(), and setParameters().

◆ $performer

User ManualLogEntry::$performer
protected

Performer of the action for the log entry *.

Definition at line 348 of file LogEntry.php.

Referenced by getPerformer(), and setPerformer().

◆ $relations

array ManualLogEntry::$relations = array()
protected

Definition at line 346 of file LogEntry.php.

Referenced by setRelations().

◆ $subtype

string ManualLogEntry::$subtype
protected

Sub type of log entry *.

Definition at line 342 of file LogEntry.php.

Referenced by __construct(), and getSubtype().

◆ $target

Title ManualLogEntry::$target
protected

Target title for the log entry *.

Definition at line 350 of file LogEntry.php.

Referenced by getTarget(), and setTarget().

◆ $timestamp

string ManualLogEntry::$timestamp
protected

Timestamp of creation of the log entry *.

Definition at line 352 of file LogEntry.php.

Referenced by setTimestamp().

◆ $type

string ManualLogEntry::$type
protected

Type of log entry *.

Definition at line 340 of file LogEntry.php.

Referenced by __construct(), and getType().


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