Merge "Improve docs for Title::getInternalURL/getCanonicalURL"
[lhc/web/wiklou.git] / includes / logging / LogEntry.php
1 <?php
2 /**
3 * Contain classes for dealing with individual log entries
4 *
5 * This is how I see the log system history:
6 * - appending to plain wiki pages
7 * - formatting log entries based on database fields
8 * - user is now part of the action message
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License along
21 * with this program; if not, write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 * http://www.gnu.org/copyleft/gpl.html
24 *
25 * @file
26 * @author Niklas Laxström
27 * @license GPL-2.0-or-later
28 * @since 1.19
29 */
30
31 use MediaWiki\ChangeTags\Taggable;
32 use MediaWiki\Linker\LinkTarget;
33 use MediaWiki\User\UserIdentity;
34 use Wikimedia\Rdbms\IDatabase;
35 use Wikimedia\Assert\Assert;
36
37 /**
38 * Interface for log entries. Every log entry has these methods.
39 *
40 * @since 1.19
41 */
42 interface LogEntry {
43
44 /**
45 * The main log type.
46 *
47 * @return string
48 */
49 public function getType();
50
51 /**
52 * The log subtype.
53 *
54 * @return string
55 */
56 public function getSubtype();
57
58 /**
59 * The full logtype in format maintype/subtype.
60 *
61 * @return string
62 */
63 public function getFullType();
64
65 /**
66 * Get the extra parameters stored for this message.
67 *
68 * @return array
69 */
70 public function getParameters();
71
72 /**
73 * Get the user for performed this action.
74 *
75 * @return User
76 */
77 public function getPerformer();
78
79 /**
80 * Get the target page of this action.
81 *
82 * @return Title
83 */
84 public function getTarget();
85
86 /**
87 * Get the timestamp when the action was executed.
88 *
89 * @return string
90 */
91 public function getTimestamp();
92
93 /**
94 * Get the user provided comment.
95 *
96 * @return string
97 */
98 public function getComment();
99
100 /**
101 * Get the access restriction.
102 *
103 * @return int
104 */
105 public function getDeleted();
106
107 /**
108 * @param int $field One of LogPage::DELETED_* bitfield constants
109 * @return bool
110 */
111 public function isDeleted( $field );
112 }
113
114 /**
115 * Extends the LogEntryInterface with some basic functionality
116 *
117 * @since 1.19
118 */
119 abstract class LogEntryBase implements LogEntry {
120
121 public function getFullType() {
122 return $this->getType() . '/' . $this->getSubtype();
123 }
124
125 public function isDeleted( $field ) {
126 return ( $this->getDeleted() & $field ) === $field;
127 }
128
129 /**
130 * Whether the parameters for this log are stored in new or
131 * old format.
132 *
133 * @return bool
134 */
135 public function isLegacy() {
136 return false;
137 }
138
139 /**
140 * Create a blob from a parameter array
141 *
142 * @since 1.26
143 * @param array $params
144 * @return string
145 */
146 public static function makeParamBlob( $params ) {
147 return serialize( (array)$params );
148 }
149
150 /**
151 * Extract a parameter array from a blob
152 *
153 * @since 1.26
154 * @param string $blob
155 * @return array
156 */
157 public static function extractParams( $blob ) {
158 return unserialize( $blob );
159 }
160 }
161
162 /**
163 * A value class to process existing log entries. In other words, this class caches a log
164 * entry from the database and provides an immutable object-oriented representation of it.
165 *
166 * @since 1.19
167 */
168 class DatabaseLogEntry extends LogEntryBase {
169
170 /**
171 * Returns array of information that is needed for querying
172 * log entries. Array contains the following keys:
173 * tables, fields, conds, options and join_conds
174 *
175 * @return array
176 */
177 public static function getSelectQueryData() {
178 $commentQuery = CommentStore::getStore()->getJoin( 'log_comment' );
179 $actorQuery = ActorMigration::newMigration()->getJoin( 'log_user' );
180
181 $tables = array_merge(
182 [ 'logging' ], $commentQuery['tables'], $actorQuery['tables'], [ 'user' ]
183 );
184 $fields = [
185 'log_id', 'log_type', 'log_action', 'log_timestamp',
186 'log_namespace', 'log_title', // unused log_page
187 'log_params', 'log_deleted',
188 'user_id', 'user_name', 'user_editcount',
189 ] + $commentQuery['fields'] + $actorQuery['fields'];
190
191 $joins = [
192 // IPs don't have an entry in user table
193 'user' => [ 'LEFT JOIN', 'user_id=' . $actorQuery['fields']['log_user'] ],
194 ] + $commentQuery['joins'] + $actorQuery['joins'];
195
196 return [
197 'tables' => $tables,
198 'fields' => $fields,
199 'conds' => [],
200 'options' => [],
201 'join_conds' => $joins,
202 ];
203 }
204
205 /**
206 * Constructs new LogEntry from database result row.
207 * Supports rows from both logging and recentchanges table.
208 *
209 * @param stdClass|array $row
210 * @return DatabaseLogEntry
211 */
212 public static function newFromRow( $row ) {
213 $row = (object)$row;
214 if ( isset( $row->rc_logid ) ) {
215 return new RCDatabaseLogEntry( $row );
216 } else {
217 return new self( $row );
218 }
219 }
220
221 /**
222 * Loads a LogEntry with the given id from database
223 *
224 * @param int $id
225 * @param IDatabase $db
226 * @return DatabaseLogEntry|null
227 */
228 public static function newFromId( $id, IDatabase $db ) {
229 $queryInfo = self::getSelectQueryData();
230 $queryInfo['conds'] += [ 'log_id' => $id ];
231 $row = $db->selectRow(
232 $queryInfo['tables'],
233 $queryInfo['fields'],
234 $queryInfo['conds'],
235 __METHOD__,
236 $queryInfo['options'],
237 $queryInfo['join_conds']
238 );
239 if ( !$row ) {
240 return null;
241 }
242 return self::newFromRow( $row );
243 }
244
245 /** @var stdClass Database result row. */
246 protected $row;
247
248 /** @var User */
249 protected $performer;
250
251 /** @var array Parameters for log entry */
252 protected $params;
253
254 /** @var int A rev id associated to the log entry */
255 protected $revId = null;
256
257 /** @var bool Whether the parameters for this log entry are stored in new or old format. */
258 protected $legacy;
259
260 protected function __construct( $row ) {
261 $this->row = $row;
262 }
263
264 /**
265 * Returns the unique database id.
266 *
267 * @return int
268 */
269 public function getId() {
270 return (int)$this->row->log_id;
271 }
272
273 /**
274 * Returns whatever is stored in the database field.
275 *
276 * @return string
277 */
278 protected function getRawParameters() {
279 return $this->row->log_params;
280 }
281
282 public function isLegacy() {
283 // This extracts the property
284 $this->getParameters();
285 return $this->legacy;
286 }
287
288 public function getType() {
289 return $this->row->log_type;
290 }
291
292 public function getSubtype() {
293 return $this->row->log_action;
294 }
295
296 public function getParameters() {
297 if ( !isset( $this->params ) ) {
298 $blob = $this->getRawParameters();
299 Wikimedia\suppressWarnings();
300 $params = LogEntryBase::extractParams( $blob );
301 Wikimedia\restoreWarnings();
302 if ( $params !== false ) {
303 $this->params = $params;
304 $this->legacy = false;
305 } else {
306 $this->params = LogPage::extractParams( $blob );
307 $this->legacy = true;
308 }
309
310 if ( isset( $this->params['associated_rev_id'] ) ) {
311 $this->revId = $this->params['associated_rev_id'];
312 unset( $this->params['associated_rev_id'] );
313 }
314 }
315
316 return $this->params;
317 }
318
319 public function getAssociatedRevId() {
320 // This extracts the property
321 $this->getParameters();
322 return $this->revId;
323 }
324
325 public function getPerformer() {
326 if ( !$this->performer ) {
327 $actorId = isset( $this->row->log_actor ) ? (int)$this->row->log_actor : 0;
328 $userId = (int)$this->row->log_user;
329 if ( $userId !== 0 || $actorId !== 0 ) {
330 // logged-in users
331 if ( isset( $this->row->user_name ) ) {
332 $this->performer = User::newFromRow( $this->row );
333 } elseif ( $actorId !== 0 ) {
334 $this->performer = User::newFromActorId( $actorId );
335 } else {
336 $this->performer = User::newFromId( $userId );
337 }
338 } else {
339 // IP users
340 $userText = $this->row->log_user_text;
341 $this->performer = User::newFromName( $userText, false );
342 }
343 }
344
345 return $this->performer;
346 }
347
348 public function getTarget() {
349 $namespace = $this->row->log_namespace;
350 $page = $this->row->log_title;
351 $title = Title::makeTitle( $namespace, $page );
352
353 return $title;
354 }
355
356 public function getTimestamp() {
357 return wfTimestamp( TS_MW, $this->row->log_timestamp );
358 }
359
360 public function getComment() {
361 return CommentStore::getStore()->getComment( 'log_comment', $this->row )->text;
362 }
363
364 public function getDeleted() {
365 return $this->row->log_deleted;
366 }
367 }
368
369 /**
370 * A subclass of DatabaseLogEntry for objects constructed from entries in the
371 * recentchanges table (rather than the logging table).
372 */
373 class RCDatabaseLogEntry extends DatabaseLogEntry {
374
375 public function getId() {
376 return $this->row->rc_logid;
377 }
378
379 protected function getRawParameters() {
380 return $this->row->rc_params;
381 }
382
383 public function getAssociatedRevId() {
384 return $this->row->rc_this_oldid;
385 }
386
387 public function getType() {
388 return $this->row->rc_log_type;
389 }
390
391 public function getSubtype() {
392 return $this->row->rc_log_action;
393 }
394
395 public function getPerformer() {
396 if ( !$this->performer ) {
397 $actorId = isset( $this->row->rc_actor ) ? (int)$this->row->rc_actor : 0;
398 $userId = (int)$this->row->rc_user;
399 if ( $actorId !== 0 ) {
400 $this->performer = User::newFromActorId( $actorId );
401 } elseif ( $userId !== 0 ) {
402 $this->performer = User::newFromId( $userId );
403 } else {
404 $userText = $this->row->rc_user_text;
405 // Might be an IP, don't validate the username
406 $this->performer = User::newFromName( $userText, false );
407 }
408 }
409
410 return $this->performer;
411 }
412
413 public function getTarget() {
414 $namespace = $this->row->rc_namespace;
415 $page = $this->row->rc_title;
416 $title = Title::makeTitle( $namespace, $page );
417
418 return $title;
419 }
420
421 public function getTimestamp() {
422 return wfTimestamp( TS_MW, $this->row->rc_timestamp );
423 }
424
425 public function getComment() {
426 return CommentStore::getStore()
427 // Legacy because the row may have used RecentChange::selectFields()
428 ->getCommentLegacy( wfGetDB( DB_REPLICA ), 'rc_comment', $this->row )->text;
429 }
430
431 public function getDeleted() {
432 return $this->row->rc_deleted;
433 }
434 }
435
436 /**
437 * Class for creating new log entries and inserting them into the database.
438 *
439 * @since 1.19
440 */
441 class ManualLogEntry extends LogEntryBase implements Taggable {
442 /** @var string Type of log entry */
443 protected $type;
444
445 /** @var string Sub type of log entry */
446 protected $subtype;
447
448 /** @var array Parameters for log entry */
449 protected $parameters = [];
450
451 /** @var array */
452 protected $relations = [];
453
454 /** @var User Performer of the action for the log entry */
455 protected $performer;
456
457 /** @var Title Target title for the log entry */
458 protected $target;
459
460 /** @var string Timestamp of creation of the log entry */
461 protected $timestamp;
462
463 /** @var string Comment for the log entry */
464 protected $comment = '';
465
466 /** @var int A rev id associated to the log entry */
467 protected $revId = 0;
468
469 /** @var string[] Change tags add to the log entry */
470 protected $tags = [];
471
472 /** @var int Deletion state of the log entry */
473 protected $deleted;
474
475 /** @var int ID of the log entry */
476 protected $id;
477
478 /** @var bool Can this log entry be patrolled? */
479 protected $isPatrollable = false;
480
481 /** @var bool Whether this is a legacy log entry */
482 protected $legacy = false;
483
484 /**
485 * @since 1.19
486 * @param string $type
487 * @param string $subtype
488 */
489 public function __construct( $type, $subtype ) {
490 $this->type = $type;
491 $this->subtype = $subtype;
492 }
493
494 /**
495 * Set extra log parameters.
496 *
497 * You can pass params to the log action message by prefixing the keys with
498 * a number and optional type, using colons to separate the fields. The
499 * numbering should start with number 4, the first three parameters are
500 * hardcoded for every message.
501 *
502 * If you want to store stuff that should not be available in messages, don't
503 * prefix the array key with a number and don't use the colons.
504 *
505 * Example:
506 * $entry->setParameters(
507 * '4::color' => 'blue',
508 * '5:number:count' => 3000,
509 * 'animal' => 'dog'
510 * );
511 *
512 * @since 1.19
513 * @param array $parameters Associative array
514 */
515 public function setParameters( $parameters ) {
516 $this->parameters = $parameters;
517 }
518
519 /**
520 * Declare arbitrary tag/value relations to this log entry.
521 * These can be used to filter log entries later on.
522 *
523 * @param array $relations Map of (tag => (list of values|value))
524 * @since 1.22
525 */
526 public function setRelations( array $relations ) {
527 $this->relations = $relations;
528 }
529
530 /**
531 * Set the user that performed the action being logged.
532 *
533 * @since 1.19
534 * @param UserIdentity $performer
535 */
536 public function setPerformer( UserIdentity $performer ) {
537 $this->performer = User::newFromIdentity( $performer );
538 }
539
540 /**
541 * Set the title of the object changed.
542 *
543 * @since 1.19
544 * @param LinkTarget $target
545 */
546 public function setTarget( LinkTarget $target ) {
547 $this->target = Title::newFromLinkTarget( $target );
548 }
549
550 /**
551 * Set the timestamp of when the logged action took place.
552 *
553 * @since 1.19
554 * @param string $timestamp
555 */
556 public function setTimestamp( $timestamp ) {
557 $this->timestamp = $timestamp;
558 }
559
560 /**
561 * Set a comment associated with the action being logged.
562 *
563 * @since 1.19
564 * @param string $comment
565 */
566 public function setComment( $comment ) {
567 $this->comment = $comment;
568 }
569
570 /**
571 * Set an associated revision id.
572 *
573 * For example, the ID of the revision that was inserted to mark a page move
574 * or protection, file upload, etc.
575 *
576 * @since 1.27
577 * @param int $revId
578 */
579 public function setAssociatedRevId( $revId ) {
580 $this->revId = $revId;
581 }
582
583 /**
584 * Set change tags for the log entry.
585 *
586 * Passing `null` means the same as empty array,
587 * for compatibility with WikiPage::doUpdateRestrictions().
588 *
589 * @since 1.27
590 * @param string|string[]|null $tags
591 * @deprecated since 1.33 Please use addTags() instead
592 */
593 public function setTags( $tags ) {
594 if ( $this->tags ) {
595 wfDebug( 'Overwriting existing ManualLogEntry tags' );
596 }
597 $this->tags = [];
598 if ( $tags !== null ) {
599 $this->addTags( $tags );
600 }
601 }
602
603 /**
604 * Add change tags for the log entry
605 *
606 * @since 1.33
607 * @param string|string[] $tags Tags to apply
608 */
609 public function addTags( $tags ) {
610 if ( is_string( $tags ) ) {
611 $tags = [ $tags ];
612 }
613 Assert::parameterElementType( 'string', $tags, 'tags' );
614 $this->tags = array_unique( array_merge( $this->tags, $tags ) );
615 }
616
617 /**
618 * Set whether this log entry should be made patrollable
619 * This shouldn't depend on config, only on whether there is full support
620 * in the software for patrolling this log entry.
621 * False by default
622 *
623 * @since 1.27
624 * @param bool $patrollable
625 */
626 public function setIsPatrollable( $patrollable ) {
627 $this->isPatrollable = (bool)$patrollable;
628 }
629
630 /**
631 * Set the 'legacy' flag
632 *
633 * @since 1.25
634 * @param bool $legacy
635 */
636 public function setLegacy( $legacy ) {
637 $this->legacy = $legacy;
638 }
639
640 /**
641 * Set the 'deleted' flag.
642 *
643 * @since 1.19
644 * @param int $deleted One of LogPage::DELETED_* bitfield constants
645 */
646 public function setDeleted( $deleted ) {
647 $this->deleted = $deleted;
648 }
649
650 /**
651 * Insert the entry into the `logging` table.
652 *
653 * @param IDatabase|null $dbw
654 * @return int ID of the log entry
655 * @throws MWException
656 */
657 public function insert( IDatabase $dbw = null ) {
658 global $wgActorTableSchemaMigrationStage;
659
660 $dbw = $dbw ?: wfGetDB( DB_MASTER );
661
662 if ( $this->timestamp === null ) {
663 $this->timestamp = wfTimestampNow();
664 }
665
666 // Trim spaces on user supplied text
667 $comment = trim( $this->getComment() );
668
669 $params = $this->getParameters();
670 $relations = $this->relations;
671
672 // Ensure actor relations are set
673 if ( ( $wgActorTableSchemaMigrationStage & SCHEMA_COMPAT_WRITE_NEW ) &&
674 empty( $relations['target_author_actor'] )
675 ) {
676 $actorIds = [];
677 if ( !empty( $relations['target_author_id'] ) ) {
678 foreach ( $relations['target_author_id'] as $id ) {
679 $actorIds[] = User::newFromId( $id )->getActorId( $dbw );
680 }
681 }
682 if ( !empty( $relations['target_author_ip'] ) ) {
683 foreach ( $relations['target_author_ip'] as $ip ) {
684 $actorIds[] = User::newFromName( $ip, false )->getActorId( $dbw );
685 }
686 }
687 if ( $actorIds ) {
688 $relations['target_author_actor'] = $actorIds;
689 $params['authorActors'] = $actorIds;
690 }
691 }
692 if ( !( $wgActorTableSchemaMigrationStage & SCHEMA_COMPAT_WRITE_OLD ) ) {
693 unset( $relations['target_author_id'], $relations['target_author_ip'] );
694 unset( $params['authorIds'], $params['authorIPs'] );
695 }
696
697 // Additional fields for which there's no space in the database table schema
698 $revId = $this->getAssociatedRevId();
699 if ( $revId ) {
700 $params['associated_rev_id'] = $revId;
701 $relations['associated_rev_id'] = $revId;
702 }
703
704 $data = [
705 'log_type' => $this->getType(),
706 'log_action' => $this->getSubtype(),
707 'log_timestamp' => $dbw->timestamp( $this->getTimestamp() ),
708 'log_namespace' => $this->getTarget()->getNamespace(),
709 'log_title' => $this->getTarget()->getDBkey(),
710 'log_page' => $this->getTarget()->getArticleID(),
711 'log_params' => LogEntryBase::makeParamBlob( $params ),
712 ];
713 if ( isset( $this->deleted ) ) {
714 $data['log_deleted'] = $this->deleted;
715 }
716 $data += CommentStore::getStore()->insert( $dbw, 'log_comment', $comment );
717 $data += ActorMigration::newMigration()
718 ->getInsertValues( $dbw, 'log_user', $this->getPerformer() );
719
720 $dbw->insert( 'logging', $data, __METHOD__ );
721 $this->id = $dbw->insertId();
722
723 $rows = [];
724 foreach ( $relations as $tag => $values ) {
725 if ( !strlen( $tag ) ) {
726 throw new MWException( "Got empty log search tag." );
727 }
728
729 if ( !is_array( $values ) ) {
730 $values = [ $values ];
731 }
732
733 foreach ( $values as $value ) {
734 $rows[] = [
735 'ls_field' => $tag,
736 'ls_value' => $value,
737 'ls_log_id' => $this->id
738 ];
739 }
740 }
741 if ( count( $rows ) ) {
742 $dbw->insert( 'log_search', $rows, __METHOD__, 'IGNORE' );
743 }
744
745 return $this->id;
746 }
747
748 /**
749 * Get a RecentChanges object for the log entry
750 *
751 * @param int $newId
752 * @return RecentChange
753 * @since 1.23
754 */
755 public function getRecentChange( $newId = 0 ) {
756 $formatter = LogFormatter::newFromEntry( $this );
757 $context = RequestContext::newExtraneousContext( $this->getTarget() );
758 $formatter->setContext( $context );
759
760 $logpage = SpecialPage::getTitleFor( 'Log', $this->getType() );
761 $user = $this->getPerformer();
762 $ip = "";
763 if ( $user->isAnon() ) {
764 // "MediaWiki default" and friends may have
765 // no IP address in their name
766 if ( IP::isIPAddress( $user->getName() ) ) {
767 $ip = $user->getName();
768 }
769 }
770
771 return RecentChange::newLogEntry(
772 $this->getTimestamp(),
773 $logpage,
774 $user,
775 $formatter->getPlainActionText(),
776 $ip,
777 $this->getType(),
778 $this->getSubtype(),
779 $this->getTarget(),
780 $this->getComment(),
781 LogEntryBase::makeParamBlob( $this->getParameters() ),
782 $newId,
783 $formatter->getIRCActionComment(), // Used for IRC feeds
784 $this->getAssociatedRevId(), // Used for e.g. moves and uploads
785 $this->getIsPatrollable()
786 );
787 }
788
789 /**
790 * Publish the log entry.
791 *
792 * @param int $newId Id of the log entry.
793 * @param string $to One of: rcandudp (default), rc, udp
794 */
795 public function publish( $newId, $to = 'rcandudp' ) {
796 $canAddTags = true;
797 // FIXME: this code should be removed once all callers properly call publish()
798 if ( $to === 'udp' && !$newId && !$this->getAssociatedRevId() ) {
799 \MediaWiki\Logger\LoggerFactory::getInstance( 'logging' )->warning(
800 'newId and/or revId must be set when calling ManualLogEntry::publish()',
801 [
802 'newId' => $newId,
803 'to' => $to,
804 'revId' => $this->getAssociatedRevId(),
805 // pass a new exception to register the stack trace
806 'exception' => new RuntimeException()
807 ]
808 );
809 $canAddTags = false;
810 }
811
812 DeferredUpdates::addCallableUpdate(
813 function () use ( $newId, $to, $canAddTags ) {
814 $log = new LogPage( $this->getType() );
815 if ( !$log->isRestricted() ) {
816 Hooks::runWithoutAbort( 'ManualLogEntryBeforePublish', [ $this ] );
817 $rc = $this->getRecentChange( $newId );
818
819 if ( $to === 'rc' || $to === 'rcandudp' ) {
820 // save RC, passing tags so they are applied there
821 $rc->addTags( $this->getTags() );
822 $rc->save( $rc::SEND_NONE );
823 } else {
824 $tags = $this->getTags();
825 if ( $tags && $canAddTags ) {
826 $revId = $this->getAssociatedRevId();
827 ChangeTags::addTags(
828 $tags,
829 null,
830 $revId > 0 ? $revId : null,
831 $newId > 0 ? $newId : null
832 );
833 }
834 }
835
836 if ( $to === 'udp' || $to === 'rcandudp' ) {
837 $rc->notifyRCFeeds();
838 }
839 }
840 },
841 DeferredUpdates::POSTSEND,
842 wfGetDB( DB_MASTER )
843 );
844 }
845
846 public function getType() {
847 return $this->type;
848 }
849
850 public function getSubtype() {
851 return $this->subtype;
852 }
853
854 public function getParameters() {
855 return $this->parameters;
856 }
857
858 /**
859 * @return User
860 */
861 public function getPerformer() {
862 return $this->performer;
863 }
864
865 /**
866 * @return Title
867 */
868 public function getTarget() {
869 return $this->target;
870 }
871
872 public function getTimestamp() {
873 $ts = $this->timestamp ?? wfTimestampNow();
874
875 return wfTimestamp( TS_MW, $ts );
876 }
877
878 public function getComment() {
879 return $this->comment;
880 }
881
882 /**
883 * @since 1.27
884 * @return int
885 */
886 public function getAssociatedRevId() {
887 return $this->revId;
888 }
889
890 /**
891 * @since 1.27
892 * @return string[]
893 */
894 public function getTags() {
895 return $this->tags;
896 }
897
898 /**
899 * Whether this log entry is patrollable
900 *
901 * @since 1.27
902 * @return bool
903 */
904 public function getIsPatrollable() {
905 return $this->isPatrollable;
906 }
907
908 /**
909 * @since 1.25
910 * @return bool
911 */
912 public function isLegacy() {
913 return $this->legacy;
914 }
915
916 public function getDeleted() {
917 return (int)$this->deleted;
918 }
919 }