MediaWiki REL1_39
DatabaseLogEntry Class Reference

A value class to process existing log entries. More...

Inheritance diagram for DatabaseLogEntry:
Collaboration diagram for DatabaseLogEntry:

Public Member Functions

 getAssociatedRevId ()
 
 getComment ()
 Get the user provided comment.
 
 getDeleted ()
 Get the access restriction.
 
 getId ()
 Returns the unique database id.
 
 getParameters ()
 Get the extra parameters stored for this message.
 
 getPerformerIdentity ()
 
 getSubtype ()
 The log subtype.
 
 getTarget ()
 Get the target page of this action.
 
 getTimestamp ()
 Get the timestamp when the action was executed.
 
 getType ()
 The main log type.
 
 isLegacy ()
 Whether the parameters for this log are stored in new or old format.
 
- Public Member Functions inherited from LogEntryBase
 getFullType ()
 The full logtype in format maintype/subtype.
 
 isDeleted ( $field)
 

Static Public Member Functions

static getSelectQueryData ()
 Returns array of information that is needed for querying log entries.
 
static newFromId ( $id, IDatabase $db)
 Loads a LogEntry with the given id from database.
 
static newFromRow ( $row)
 Constructs new LogEntry from database result row.
 
- 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.
 

Protected Member Functions

 __construct ( $row)
 
 getRawParameters ()
 Returns whatever is stored in the database field.
 

Protected Attributes

bool $legacy
 Whether the parameters for this log entry are stored in new or old format.
 
array $params
 Parameters for log entry.
 
UserIdentity $performer
 
int $revId = null
 A rev id associated to the log entry.
 
stdClass $row
 Database result row.
 

Detailed Description

A value class to process existing log entries.

In other words, this class caches a log entry from the database and provides an immutable object-oriented representation of it.

This class should only be used in context of the LogFormatter class.

Since
1.19

Definition at line 40 of file DatabaseLogEntry.php.

Constructor & Destructor Documentation

◆ __construct()

DatabaseLogEntry::__construct ( $row)
protected

Definition at line 145 of file DatabaseLogEntry.php.

Member Function Documentation

◆ getAssociatedRevId()

DatabaseLogEntry::getAssociatedRevId ( )

Reimplemented in RCDatabaseLogEntry.

Definition at line 204 of file DatabaseLogEntry.php.

References getParameters().

◆ getComment()

DatabaseLogEntry::getComment ( )

Get the user provided comment.

Returns
string

Implements LogEntry.

Reimplemented in RCDatabaseLogEntry.

Definition at line 242 of file DatabaseLogEntry.php.

◆ getDeleted()

DatabaseLogEntry::getDeleted ( )

Get the access restriction.

Returns
int

Implements LogEntry.

Reimplemented in RCDatabaseLogEntry.

Definition at line 246 of file DatabaseLogEntry.php.

◆ getId()

DatabaseLogEntry::getId ( )

Returns the unique database id.

Returns
int

Reimplemented in RCDatabaseLogEntry.

Definition at line 154 of file DatabaseLogEntry.php.

Referenced by getPerformerIdentity().

◆ getParameters()

DatabaseLogEntry::getParameters ( )

Get the extra parameters stored for this message.

Returns
array

Implements LogEntry.

Definition at line 181 of file DatabaseLogEntry.php.

References $blob, LogEntryBase\extractParams(), LogPage\extractParams(), and getRawParameters().

Referenced by getAssociatedRevId(), and isLegacy().

◆ getPerformerIdentity()

DatabaseLogEntry::getPerformerIdentity ( )
Since
1.36
Returns
UserIdentity

Implements LogEntry.

Reimplemented in RCDatabaseLogEntry.

Definition at line 210 of file DatabaseLogEntry.php.

References getId().

◆ getRawParameters()

DatabaseLogEntry::getRawParameters ( )
protected

Returns whatever is stored in the database field.

Returns
string

Reimplemented in RCDatabaseLogEntry.

Definition at line 163 of file DatabaseLogEntry.php.

Referenced by getParameters().

◆ getSelectQueryData()

static DatabaseLogEntry::getSelectQueryData ( )
static

Returns array of information that is needed for querying log entries.

Array contains the following keys: tables, fields, conds, options and join_conds

Since 1.34, log_user and log_user_text have not been present in the database, but they continue to be available in query results as aliases.

Returns
array

Reimplemented in RCDatabaseLogEntry.

Definition at line 53 of file DatabaseLogEntry.php.

◆ getSubtype()

DatabaseLogEntry::getSubtype ( )

The log subtype.

Returns
string

Implements LogEntry.

Reimplemented in RCDatabaseLogEntry.

Definition at line 177 of file DatabaseLogEntry.php.

◆ getTarget()

DatabaseLogEntry::getTarget ( )

Get the target page of this action.

Returns
Title

Implements LogEntry.

Reimplemented in RCDatabaseLogEntry.

Definition at line 232 of file DatabaseLogEntry.php.

◆ getTimestamp()

DatabaseLogEntry::getTimestamp ( )

Get the timestamp when the action was executed.

Returns
string

Implements LogEntry.

Reimplemented in RCDatabaseLogEntry.

Definition at line 238 of file DatabaseLogEntry.php.

References wfTimestamp().

◆ getType()

DatabaseLogEntry::getType ( )

The main log type.

Returns
string

Implements LogEntry.

Reimplemented in RCDatabaseLogEntry.

Definition at line 173 of file DatabaseLogEntry.php.

◆ isLegacy()

DatabaseLogEntry::isLegacy ( )

Whether the parameters for this log are stored in new or old format.

Returns
bool

Reimplemented from LogEntryBase.

Definition at line 167 of file DatabaseLogEntry.php.

References getParameters().

◆ newFromId()

static DatabaseLogEntry::newFromId ( $id,
IDatabase $db )
static

Loads a LogEntry with the given id from database.

Parameters
int$id
IDatabase$db
Returns
DatabaseLogEntry|null

Reimplemented in RCDatabaseLogEntry.

Definition at line 113 of file DatabaseLogEntry.php.

References $row, and Wikimedia\Rdbms\IDatabase\selectRow().

◆ newFromRow()

static DatabaseLogEntry::newFromRow ( $row)
static

Constructs new LogEntry from database result row.

Supports rows from both logging and recentchanges table.

Parameters
stdClass | array$row
Returns
DatabaseLogEntry

Definition at line 97 of file DatabaseLogEntry.php.

References $row.

Member Data Documentation

◆ $legacy

bool DatabaseLogEntry::$legacy
protected

Whether the parameters for this log entry are stored in new or old format.

Definition at line 143 of file DatabaseLogEntry.php.

◆ $params

array DatabaseLogEntry::$params
protected

Parameters for log entry.

Definition at line 137 of file DatabaseLogEntry.php.

◆ $performer

UserIdentity DatabaseLogEntry::$performer
protected

Definition at line 134 of file DatabaseLogEntry.php.

◆ $revId

int DatabaseLogEntry::$revId = null
protected

A rev id associated to the log entry.

Definition at line 140 of file DatabaseLogEntry.php.

◆ $row

stdClass DatabaseLogEntry::$row
protected

Database result row.

Definition at line 131 of file DatabaseLogEntry.php.

Referenced by newFromId(), and newFromRow().


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