46 $commentQuery = CommentStore::getStore()->getJoin(
'log_comment' );
47 $actorQuery = ActorMigration::newMigration()->getJoin(
'log_user' );
49 $tables = array_merge(
50 [
'logging' ], $commentQuery[
'tables'], $actorQuery[
'tables'], [
'user' ]
53 'log_id',
'log_type',
'log_action',
'log_timestamp',
54 'log_namespace',
'log_title',
55 'log_params',
'log_deleted',
56 'user_id',
'user_name',
'user_editcount',
57 ] + $commentQuery[
'fields'] + $actorQuery[
'fields'];
61 'user' => [
'LEFT JOIN',
'user_id=' . $actorQuery[
'fields'][
'log_user'] ],
62 ] + $commentQuery[
'joins'] + $actorQuery[
'joins'];
69 'join_conds' => $joins,
82 if ( isset(
$row->rc_logid ) ) {
85 return new self(
$row );
97 $queryInfo = self::getSelectQueryData();
98 $queryInfo[
'conds'] += [
'log_id' => $id ];
100 $queryInfo[
'tables'],
101 $queryInfo[
'fields'],
104 $queryInfo[
'options'],
105 $queryInfo[
'join_conds']
110 return self::newFromRow(
$row );
138 return (
int)$this->row->log_id;
147 return $this->row->log_params;
153 return $this->legacy;
157 return $this->row->log_type;
161 return $this->row->log_action;
165 if ( !isset( $this->params ) ) {
167 Wikimedia\suppressWarnings();
169 Wikimedia\restoreWarnings();
172 $this->legacy =
false;
175 $this->legacy =
true;
178 if ( isset( $this->params[
'associated_rev_id'] ) ) {
179 $this->revId = $this->params[
'associated_rev_id'];
180 unset( $this->params[
'associated_rev_id'] );
184 return $this->params;
194 if ( !$this->performer ) {
195 $actorId = isset( $this->row->log_actor ) ? (int)$this->row->log_actor : 0;
196 $userId = (int)$this->row->log_user;
197 if ( $userId !== 0 || $actorId !== 0 ) {
199 if ( isset( $this->row->user_name ) ) {
201 } elseif ( $actorId !== 0 ) {
208 $userText = $this->row->log_user_text;
213 return $this->performer;
217 $namespace = $this->row->log_namespace;
218 $page = $this->row->log_title;
219 return Title::makeTitle( $namespace, $page );
223 return wfTimestamp( TS_MW, $this->row->log_timestamp );
227 return CommentStore::getStore()->getComment(
'log_comment', $this->row )->text;
231 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,...
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
static newFromRow( $row, $data=null)
Create a new user object from a user row.
static newFromId( $id)
Static factory method for creation from a given user ID.
static newFromActorId( $id)
Static factory method for creation from a given actor ID.