44 $commentQuery = CommentStore::getStore()->getJoin(
'log_comment' );
45 $actorQuery = ActorMigration::newMigration()->getJoin(
'log_user' );
47 $tables = array_merge(
48 [
'logging' ], $commentQuery[
'tables'], $actorQuery[
'tables'], [
'user' ]
51 'log_id',
'log_type',
'log_action',
'log_timestamp',
52 'log_namespace',
'log_title',
53 'log_params',
'log_deleted',
54 'user_id',
'user_name',
'user_editcount',
55 ] + $commentQuery[
'fields'] + $actorQuery[
'fields'];
59 'user' => [
'LEFT JOIN',
'user_id=' . $actorQuery[
'fields'][
'log_user'] ],
60 ] + $commentQuery[
'joins'] + $actorQuery[
'joins'];
67 'join_conds' => $joins,
80 if ( isset(
$row->rc_logid ) ) {
83 return new self(
$row );
96 $queryInfo[
'conds'] += [
'log_id' => $id ];
102 $queryInfo[
'options'],
103 $queryInfo[
'join_conds']
136 return (
int)$this->row->log_id;
145 return $this->row->log_params;
155 return $this->row->log_type;
159 return $this->row->log_action;
163 if ( !isset( $this->params ) ) {
165 Wikimedia\suppressWarnings();
167 Wikimedia\restoreWarnings();
170 $this->legacy =
false;
173 $this->legacy =
true;
176 if ( isset( $this->params[
'associated_rev_id'] ) ) {
177 $this->revId = $this->params[
'associated_rev_id'];
178 unset( $this->params[
'associated_rev_id'] );
192 if ( !$this->performer ) {
193 $actorId = isset( $this->row->log_actor ) ? (int)$this->row->log_actor : 0;
194 $userId = (int)$this->row->log_user;
195 if ( $userId !== 0 || $actorId !== 0 ) {
197 if ( isset( $this->row->user_name ) ) {
198 $this->performer = User::newFromRow( $this->row );
199 } elseif ( $actorId !== 0 ) {
200 $this->performer = User::newFromActorId( $actorId );
202 $this->performer = User::newFromId( $userId );
206 $userText = $this->row->log_user_text;
207 $this->performer = User::newFromName( $userText,
false );
215 $namespace = $this->row->log_namespace;
216 $page = $this->row->log_title;
217 return Title::makeTitle( $namespace, $page );
221 return wfTimestamp( TS_MW, $this->row->log_timestamp );
225 return CommentStore::getStore()->getComment(
'log_comment', $this->row )->text;
229 return $this->row->log_deleted;
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
A value class to process existing log entries.
getParameters()
Get the extra parameters stored for this message.
isLegacy()
Whether the parameters for this log are stored in new or old format.
array $params
Parameters for log entry.
getSubtype()
The log subtype.
getDeleted()
Get the access restriction.
static newFromRow( $row)
Constructs new LogEntry from database result row.
getComment()
Get the user provided comment.
bool $legacy
Whether the parameters for this log entry are stored in new or old format.
int $revId
A rev id associated to the log entry.
getRawParameters()
Returns whatever is stored in the database field.
static getSelectQueryData()
Returns array of information that is needed for querying log entries.
stdClass $row
Database result row.
getId()
Returns the unique database id.
getPerformer()
Get the user who performed this action.
getTarget()
Get the target page of this action.
getType()
The main log type.
static newFromId( $id, IDatabase $db)
Loads a LogEntry with the given id from database.
getTimestamp()
Get the timestamp when the action was executed.
Extends the LogEntry Interface with some basic functionality.
static extractParams( $blob)
Extract a parameter array from a blob.
static extractParams( $blob)
Extract a parameter array from a blob.
A subclass of DatabaseLogEntry for objects constructed from entries in the recentchanges table (rathe...
The User object encapsulates all of the user-specific settings (user_id, name, rights,...