* @ingroup Watchlist
*/
+use MediaWiki\MediaWikiServices;
+
/**
* Provides the UI through which users can perform editing
* operations on their watchlist
private function getWatchlist() {
$list = [];
- $watchedItems = WatchedItemStore::getDefaultInstance()->getWatchedItemsForUser(
+ $watchedItems = MediaWikiServices::getInstance()->getWatchedItemStore()->getWatchedItemsForUser(
$this->getUser(),
[ 'forWrite' => $this->getRequest()->wasPosted() ]
);
protected function getWatchlistInfo() {
$titles = [];
- $watchedItems = WatchedItemStore::getDefaultInstance()
+ $watchedItems = MediaWikiServices::getInstance()->getWatchedItemStore()
->getWatchedItemsForUser( $this->getUser(), [ 'sort' => WatchedItemStore::SORT_ASC ] );
$lb = new LinkBatch();
}
$user = $this->getUser();
- $store = WatchedItemStore::getDefaultInstance();
+ $store = MediaWikiServices::getInstance()->getWatchedItemStore();
foreach ( $this->badItems as $row ) {
list( $title, $namespace, $dbKey ) = $row;
$expandedTargets[] = new TitleValue( MWNamespace::getTalk( $ns ), $dbKey );
}
- WatchedItemStore::getDefaultInstance()->addWatchBatchForUser(
+ MediaWikiServices::getInstance()->getWatchedItemStore()->addWatchBatchForUser(
$this->getUser(),
$expandedTargets
);
* @param array $titles Array of strings, or Title objects
*/
private function unwatchTitles( $titles ) {
- $store = WatchedItemStore::getDefaultInstance();
+ $store = MediaWikiServices::getInstance()->getWatchedItemStore();
foreach ( $titles as $title ) {
if ( !$title instanceof Title ) {