MediaWiki  REL1_22
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:

List of all members.

Public Member Functions

 __construct ($type, $subtype)
 Constructor.
 getComment ()
 Get the user provided comment.
 getDeleted ()
 Get the access restriction.
 getParameters ()
 Get the extra parameters stored for this message.
 getPerformer ()
 getSubtype ()
 The log subtype.
 getTarget ()
 getTimestamp ()
 Get the timestamp when the action was executed.
 getType ()
 The main log type.
 insert (IDatabase $dbw=null)
 Inserts the entry into the logging table.
 publish ($newId, $to= 'rcandudp')
 Publishes the log entry.
 setComment ($comment)
 Set a comment associated with the action being logged.
 setDeleted ($deleted)
 TODO: document.
 setParameters ($parameters)
 Set extra log parameters.
 setPerformer (User $performer)
 Set the user that performed the action being logged.
 setRelations (array $relations)
 Declare arbitrary tag/value relations to this log entry.
 setTarget (Title $target)
 Set the title of the object changed.
 setTimestamp ($timestamp)
 Set the timestamp of when the logged action took place.

Protected Attributes

 $comment = ''
 $deleted
 $parameters = array()
 $performer
 $relations = array()
 $subtype
 $target
 $timestamp
 $type

Detailed Description

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

Since:
1.19

Definition at line 333 of file LogEntry.php.


Constructor & Destructor Documentation

ManualLogEntry::__construct ( type,
subtype 
)

Constructor.

Since:
1.19
Parameters:
string$type
string$subtype

Definition at line 352 of file LogEntry.php.

References $subtype, $type, and type.


Member Function Documentation

Get the user provided comment.

Returns:
string

Implements LogEntry.

Definition at line 584 of file LogEntry.php.

Referenced by insert(), and publish().

Get the access restriction.

Returns:
string

Implements LogEntry.

Definition at line 588 of file LogEntry.php.

Get the extra parameters stored for this message.

Returns:
array

Implements LogEntry.

Definition at line 561 of file LogEntry.php.

Referenced by insert(), and publish().

Returns:
User

Implements LogEntry.

Definition at line 568 of file LogEntry.php.

Referenced by insert(), and publish().

The log subtype.

Returns:
string

Implements LogEntry.

Definition at line 557 of file LogEntry.php.

Referenced by insert(), and publish().

Returns:
Title

Implements LogEntry.

Definition at line 575 of file LogEntry.php.

Referenced by insert(), and publish().

Get the timestamp when the action was executed.

Returns:
string

Implements LogEntry.

Definition at line 579 of file LogEntry.php.

References wfTimestamp(), and wfTimestampNow().

Referenced by publish().

The main log type.

Returns:
string

Implements LogEntry.

Definition at line 553 of file LogEntry.php.

References type.

Referenced by insert(), and publish().

ManualLogEntry::insert ( IDatabase dbw = null)

Inserts the entry into the logging table.

Parameters:
IDatabase$dbw
Returns:
int If of the log entry

Definition at line 448 of file LogEntry.php.

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

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

Publishes the log entry.

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

Definition at line 505 of file LogEntry.php.

References $user, array(), getComment(), getParameters(), getPerformer(), getSubtype(), getTarget(), getTimestamp(), SpecialPage\getTitleFor(), getType(), IP\isIPAddress(), RequestContext\newExtraneousContext(), LogFormatter\newFromEntry(), and RecentChange\newLogEntry().

Set a comment associated with the action being logged.

Since:
1.19
Parameters:
string$comment

Definition at line 428 of file LogEntry.php.

References $comment.

TODO: document.

Since:
1.19
Parameters:
integer$deleted

Definition at line 439 of file LogEntry.php.

References $deleted.

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 373 of file LogEntry.php.

References $parameters.

Set the user that performed the action being logged.

Since:
1.19
Parameters:
User$performer

Definition at line 395 of file LogEntry.php.

References $performer.

Declare arbitrary tag/value relations to this log entry.

These can be used to filter log entries later on.

Parameters:
arrayMap of (tag => (list of values))
Since:
1.22

Definition at line 384 of file LogEntry.php.

References $relations.

Set the title of the object changed.

Since:
1.19
Parameters:
Title$target

Definition at line 406 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 417 of file LogEntry.php.

References $timestamp.


Member Data Documentation

ManualLogEntry::$comment = '' [protected]

Definition at line 341 of file LogEntry.php.

Referenced by insert(), and setComment().

ManualLogEntry::$deleted [protected]

Definition at line 342 of file LogEntry.php.

Referenced by setDeleted().

ManualLogEntry::$parameters = array() [protected]

Definition at line 336 of file LogEntry.php.

Referenced by setParameters().

ManualLogEntry::$performer [protected]

Definition at line 338 of file LogEntry.php.

Referenced by setPerformer().

ManualLogEntry::$relations = array() [protected]

Definition at line 337 of file LogEntry.php.

Referenced by setRelations().

ManualLogEntry::$subtype [protected]

Definition at line 335 of file LogEntry.php.

Referenced by __construct().

ManualLogEntry::$target [protected]

Definition at line 339 of file LogEntry.php.

Referenced by setTarget().

ManualLogEntry::$timestamp [protected]

Definition at line 340 of file LogEntry.php.

Referenced by setTimestamp().

ManualLogEntry::$type [protected]

Definition at line 334 of file LogEntry.php.

Referenced by __construct().


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