MediaWiki  1.34.0
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 }
User\newFromId
static newFromId( $id)
Static factory method for creation from a given user ID.
Definition: User.php:539
RCDatabaseLogEntry
A subclass of DatabaseLogEntry for objects constructed from entries in the recentchanges table (rathe...
Definition: RCDatabaseLogEntry.php:30
RCDatabaseLogEntry\getAssociatedRevId
getAssociatedRevId()
Definition: RCDatabaseLogEntry.php:40
wfTimestamp
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
Definition: GlobalFunctions.php:1869
RCDatabaseLogEntry\getRawParameters
getRawParameters()
Returns whatever is stored in the database field.
Definition: RCDatabaseLogEntry.php:36
RCDatabaseLogEntry\getSubtype
getSubtype()
The log subtype.
Definition: RCDatabaseLogEntry.php:48
User\newFromName
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
Definition: User.php:515
RCDatabaseLogEntry\getId
getId()
Returns the unique database id.
Definition: RCDatabaseLogEntry.php:32
RCDatabaseLogEntry\getTimestamp
getTimestamp()
Get the timestamp when the action was executed.
Definition: RCDatabaseLogEntry.php:76
RCDatabaseLogEntry\getTarget
getTarget()
Get the target page of this action.
Definition: RCDatabaseLogEntry.php:70
wfGetDB
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
Definition: GlobalFunctions.php:2575
RCDatabaseLogEntry\getComment
getComment()
Get the user provided comment.
Definition: RCDatabaseLogEntry.php:80
Title\makeTitle
static makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
Definition: Title.php:586
DB_REPLICA
const DB_REPLICA
Definition: defines.php:25
RCDatabaseLogEntry\getType
getType()
The main log type.
Definition: RCDatabaseLogEntry.php:44
User\newFromActorId
static newFromActorId( $id)
Static factory method for creation from a given actor ID.
Definition: User.php:554
DatabaseLogEntry
A value class to process existing log entries.
Definition: DatabaseLogEntry.php:34
RCDatabaseLogEntry\getPerformer
getPerformer()
Get the user who performed this action.
Definition: RCDatabaseLogEntry.php:52
RCDatabaseLogEntry\getDeleted
getDeleted()
Get the access restriction.
Definition: RCDatabaseLogEntry.php:86
CommentStore\getStore
static getStore()
Definition: CommentStore.php:139
DatabaseLogEntry\$performer
User $performer
Definition: DatabaseLogEntry.php:115