MediaWiki REL1_32
ManualLogEntry Class Reference

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

Inheritance diagram for ManualLogEntry:
Collaboration diagram for ManualLogEntry:

Public Member Functions

 __construct ( $type, $subtype)
 
 getAssociatedRevId ()
 
 getComment ()
 Get the user provided comment.
 
 getDeleted ()
 Get the access restriction.
 
 getIsPatrollable ()
 Whether this log entry is patrollable.
 
 getParameters ()
 Get the extra parameters stored for this message.
 
 getPerformer ()
 
 getRecentChange ( $newId=0)
 Get a RecentChanges object for the log entry.
 
 getSubtype ()
 The log subtype.
 
 getTags ()
 
 getTarget ()
 
 getTimestamp ()
 Get the timestamp when the action was executed.
 
 getType ()
 The main log type.
 
 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 ( $comment)
 Set a comment associated with the action being logged.
 
 setDeleted ( $deleted)
 Set the 'deleted' flag.
 
 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 (User $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 (Title $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.
 
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.
 
User $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.
 
array $tags = null
 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.
 

Detailed Description

Class for creating new log entries and inserting them into the database.

Since
1.19

Definition at line 437 of file LogEntry.php.

Constructor & Destructor Documentation

◆ __construct()

ManualLogEntry::__construct (   $type,
  $subtype 
)
Since
1.19
Parameters
string$type
string$subtype

Definition at line 485 of file LogEntry.php.

References $type, and type.

Member Function Documentation

◆ getAssociatedRevId()

ManualLogEntry::getAssociatedRevId ( )
Since
1.27
Returns
int

Definition at line 837 of file LogEntry.php.

Referenced by insert().

◆ getComment()

ManualLogEntry::getComment ( )

Get the user provided comment.

Returns
string

Implements LogEntry.

Definition at line 829 of file LogEntry.php.

Referenced by insert().

◆ getDeleted()

ManualLogEntry::getDeleted ( )

Get the access restriction.

Returns
string

Implements LogEntry.

Definition at line 867 of file LogEntry.php.

◆ getIsPatrollable()

ManualLogEntry::getIsPatrollable ( )

Whether this log entry is patrollable.

Since
1.27
Returns
bool

Definition at line 855 of file LogEntry.php.

◆ getParameters()

ManualLogEntry::getParameters ( )

Get the extra parameters stored for this message.

Returns
array

Implements LogEntry.

Definition at line 805 of file LogEntry.php.

Referenced by insert().

◆ getPerformer()

ManualLogEntry::getPerformer ( )
Returns
User

Implements LogEntry.

Definition at line 812 of file LogEntry.php.

Referenced by getRecentChange(), and insert().

◆ getRecentChange()

ManualLogEntry::getRecentChange (   $newId = 0)

Get a RecentChanges object for the log entry.

Parameters
int$newId
Returns
RecentChange
Since
1.23

Definition at line 730 of file LogEntry.php.

References $context, $user, getPerformer(), getTarget(), getTimestamp(), getType(), LogEntryBase\makeParamBlob(), and LogFormatter\newFromEntry().

Referenced by publish().

◆ getSubtype()

ManualLogEntry::getSubtype ( )

The log subtype.

Returns
string

Implements LogEntry.

Definition at line 801 of file LogEntry.php.

Referenced by insert().

◆ getTags()

ManualLogEntry::getTags ( )
Since
1.27
Returns
array

Definition at line 845 of file LogEntry.php.

Referenced by publish().

◆ getTarget()

ManualLogEntry::getTarget ( )
Returns
Title

Implements LogEntry.

Definition at line 819 of file LogEntry.php.

Referenced by getRecentChange(), and insert().

◆ getTimestamp()

ManualLogEntry::getTimestamp ( )

Get the timestamp when the action was executed.

Returns
string

Implements LogEntry.

Definition at line 823 of file LogEntry.php.

References wfTimestamp(), and wfTimestampNow().

Referenced by getRecentChange(), and insert().

◆ getType()

ManualLogEntry::getType ( )

The main log type.

Returns
string

Implements LogEntry.

Definition at line 797 of file LogEntry.php.

References $type.

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

◆ insert()

ManualLogEntry::insert ( IDatabase  $dbw = null)

◆ isLegacy()

ManualLogEntry::isLegacy ( )
Since
1.25
Returns
bool

Reimplemented from LogEntryBase.

Definition at line 863 of file LogEntry.php.

◆ publish()

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

References DB_MASTER, getRecentChange(), getTags(), getType(), use, and wfGetDB().

◆ setAssociatedRevId()

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

◆ setComment()

ManualLogEntry::setComment (   $comment)

Set a comment associated with the action being logged.

Since
1.19
Parameters
string$comment

Definition at line 562 of file LogEntry.php.

◆ setDeleted()

ManualLogEntry::setDeleted (   $deleted)

Set the 'deleted' flag.

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

Definition at line 621 of file LogEntry.php.

◆ setIsPatrollable()

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

◆ setLegacy()

ManualLogEntry::setLegacy (   $legacy)

Set the 'legacy' flag.

Since
1.25
Parameters
bool$legacy

Definition at line 611 of file LogEntry.php.

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

◆ setPerformer()

ManualLogEntry::setPerformer ( User  $performer)

Set the user that performed the action being logged.

Since
1.19
Parameters
User$performer

Definition at line 532 of file LogEntry.php.

Referenced by EditPage\addContentModelChangeLogEntry(), and SpecialChangeContentModel\onSubmit().

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

Definition at line 522 of file LogEntry.php.

◆ setTags()

ManualLogEntry::setTags (   $tags)

Set change tags for the log entry.

Since
1.27
Parameters
string | string[]$tags

Definition at line 585 of file LogEntry.php.

◆ setTarget()

ManualLogEntry::setTarget ( Title  $target)

Set the title of the object changed.

Since
1.19
Parameters
Title$target

Definition at line 542 of file LogEntry.php.

◆ setTimestamp()

ManualLogEntry::setTimestamp (   $timestamp)

Set the timestamp of when the logged action took place.

Since
1.19
Parameters
string$timestamp

Definition at line 552 of file LogEntry.php.

Referenced by LocalFile\recordUpload2().

Member Data Documentation

◆ $comment

string ManualLogEntry::$comment = ''
protected

Comment for the log entry.

Definition at line 460 of file LogEntry.php.

◆ $deleted

int ManualLogEntry::$deleted
protected

Deletion state of the log entry.

Definition at line 469 of file LogEntry.php.

◆ $id

int ManualLogEntry::$id
protected

ID of the log entry.

Definition at line 472 of file LogEntry.php.

◆ $isPatrollable

bool ManualLogEntry::$isPatrollable = false
protected

Can this log entry be patrolled?

Definition at line 475 of file LogEntry.php.

◆ $legacy

bool ManualLogEntry::$legacy = false
protected

Whether this is a legacy log entry.

Definition at line 478 of file LogEntry.php.

◆ $parameters

array ManualLogEntry::$parameters = []
protected

Parameters for log entry.

Definition at line 445 of file LogEntry.php.

◆ $performer

User ManualLogEntry::$performer
protected

Performer of the action for the log entry.

Definition at line 451 of file LogEntry.php.

◆ $relations

array ManualLogEntry::$relations = []
protected

Definition at line 448 of file LogEntry.php.

◆ $revId

int ManualLogEntry::$revId = 0
protected

A rev id associated to the log entry.

Definition at line 463 of file LogEntry.php.

◆ $subtype

string ManualLogEntry::$subtype
protected

Sub type of log entry.

Definition at line 442 of file LogEntry.php.

◆ $tags

array ManualLogEntry::$tags = null
protected

Change tags add to the log entry.

Definition at line 466 of file LogEntry.php.

◆ $target

Title ManualLogEntry::$target
protected

Target title for the log entry.

Definition at line 454 of file LogEntry.php.

◆ $timestamp

string ManualLogEntry::$timestamp
protected

Timestamp of creation of the log entry.

Definition at line 457 of file LogEntry.php.

◆ $type

string ManualLogEntry::$type
protected

Type of log entry.

Definition at line 439 of file LogEntry.php.


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