MediaWiki  master
RCDatabaseLogEntry.php
Go to the documentation of this file.
1 <?php
31 
32  public function getId() {
33  return $this->row->rc_logid;
34  }
35 
36  protected function getRawParameters() {
37  return $this->row->rc_params;
38  }
39 
40  public function getAssociatedRevId() {
41  return $this->row->rc_this_oldid;
42  }
43 
44  public function getType() {
45  return $this->row->rc_log_type;
46  }
47 
48  public function getSubtype() {
49  return $this->row->rc_log_action;
50  }
51 
52  public function getPerformer() {
53  if ( !$this->performer ) {
54  $actorId = isset( $this->row->rc_actor ) ? (int)$this->row->rc_actor : 0;
55  $userId = (int)$this->row->rc_user;
56  if ( $actorId !== 0 ) {
57  $this->performer = User::newFromActorId( $actorId );
58  } elseif ( $userId !== 0 ) {
59  $this->performer = User::newFromId( $userId );
60  } else {
61  $userText = $this->row->rc_user_text;
62  // Might be an IP, don't validate the username
63  $this->performer = User::newFromName( $userText, false );
64  }
65  }
66 
67  return $this->performer;
68  }
69 
70  public function getTarget() {
71  $namespace = $this->row->rc_namespace;
72  $page = $this->row->rc_title;
73  return Title::makeTitle( $namespace, $page );
74  }
75 
76  public function getTimestamp() {
77  return wfTimestamp( TS_MW, $this->row->rc_timestamp );
78  }
79 
80  public function getComment() {
81  return CommentStore::getStore()
82  // Legacy because the row may have used RecentChange::selectFields()
83  ->getCommentLegacy( wfGetDB( DB_REPLICA ), 'rc_comment', $this->row )->text;
84  }
85 
86  public function getDeleted() {
87  return $this->row->rc_deleted;
88  }
89 }
A subclass of DatabaseLogEntry for objects constructed from entries in the recentchanges table (rathe...
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
getTimestamp()
Get the timestamp when the action was executed.
getType()
The main log type.
static newFromActorId( $id)
Static factory method for creation from a given actor ID.
Definition: User.php:558
getPerformer()
Get the user who performed this action.
getDeleted()
Get the access restriction.
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
getTarget()
Get the target page of this action.
static makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
Definition: Title.php:586
static newFromId( $id)
Static factory method for creation from a given user ID.
Definition: User.php:543
getComment()
Get the user provided comment.
static getStore()
const DB_REPLICA
Definition: defines.php:25
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
Definition: User.php:519
getSubtype()
The log subtype.
A value class to process existing log entries.