- $index = $this->getRequest()->wasPosted() ? DB_MASTER : DB_SLAVE;
- $dbr = wfGetDB( $index );
-
- $res = $dbr->select(
- 'watchlist',
- [
- 'wl_namespace', 'wl_title'
- ], [
- 'wl_user' => $this->getUser()->getId(),
- ],
- __METHOD__
+ $watchedItems = WatchedItemStore::getDefaultInstance()->getWatchedItemsForUser(
+ $this->getUser(),
+ [ 'forWrite' => $this->getRequest()->wasPosted() ]