Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
RecentAdditionsMessageGroup.php
Go to the documentation of this file.
1<?php
11use MediaWiki\Context\IContextSource;
13use MediaWiki\MediaWikiServices;
14use MediaWiki\RecentChanges\RecentChange;
15
22 public function getId() {
23 return '!additions';
24 }
25
27 public function getLabel( ?IContextSource $context = null ) {
28 $msg = wfMessage( 'translate-dynagroup-additions-label' );
29 $msg = self::addContext( $msg, $context );
30
31 return $msg->plain();
32 }
33
35 public function getDescription( ?IContextSource $context = null ) {
36 $msg = wfMessage( 'translate-dynagroup-additions-desc' );
37 $msg = self::addContext( $msg, $context );
38
39 return $msg->plain();
40 }
41
42 protected function getQueryConditions(): array {
43 global $wgTranslateMessageNamespaces;
44 $db = MediaWikiServices::getInstance()->getConnectionProvider()->getReplicaDatabase();
45 return [
46 'rc_title ' . $db->buildLike( $db->anyString(), '/en' ),
47 'rc_namespace' => $wgTranslateMessageNamespaces,
48 $db->expr( 'rc_source', '!=', RecentChange::SRC_LOG ),
49 'rc_id > ' . $this->getRCCutoff(),
50 'rc_actor' => FuzzyBot::getUser()->getActorId()
51 ];
52 }
53}
FuzzyBot - the misunderstood workhorse.
Definition FuzzyBot.php:15
getDescription(?IContextSource $context=null)
@inheritDoc
getQueryConditions()
Allows subclasses to partially customize the query.
getLabel(?IContextSource $context=null)
@inheritDoc