From 0291f59539ad35bfa54ed3146e83a9b5d85d55ca Mon Sep 17 00:00:00 2001 From: addshore Date: Fri, 6 May 2016 10:25:37 +0100 Subject: [PATCH] Use WIS::getNotificationTimestampsBatch in ApiSetNotifTimestamp Bug: T134387 Change-Id: I560ae6a29fa27c1e4f1f62aa647e14542b0cc8a9 --- includes/api/ApiSetNotificationTimestamp.php | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/includes/api/ApiSetNotificationTimestamp.php b/includes/api/ApiSetNotificationTimestamp.php index a299e87797..f3356821ef 100644 --- a/includes/api/ApiSetNotificationTimestamp.php +++ b/includes/api/ApiSetNotificationTimestamp.php @@ -142,17 +142,10 @@ class ApiSetNotificationTimestamp extends ApiBase { ); // Query the results of our update - $timestamps = []; - $lb = new LinkBatch( $pageSet->getTitles() ); - $res = $dbw->select( - 'watchlist', - [ 'wl_namespace', 'wl_title', 'wl_notificationtimestamp' ], - [ 'wl_user' => $user->getId(), $lb->constructSet( 'wl', $dbw ) ], - __METHOD__ + $timestamps = $watchedItemStore->getNotificationTimestampsBatch( + $user, + $pageSet->getTitles() ); - foreach ( $res as $row ) { - $timestamps[$row->wl_namespace][$row->wl_title] = $row->wl_notificationtimestamp; - } // Now, put the valid titles into the result /** @var $title Title */ -- 2.20.1