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