From: addshore Date: Fri, 6 May 2016 09:25:37 +0000 (+0100) Subject: Use WIS::getNotificationTimestampsBatch in ApiSetNotifTimestamp X-Git-Tag: 1.31.0-rc.0~6928^2 X-Git-Url: https://git.cyclocoop.org/admin/?a=commitdiff_plain;h=0291f59539ad35bfa54ed3146e83a9b5d85d55ca;p=lhc%2Fweb%2Fwiklou.git Use WIS::getNotificationTimestampsBatch in ApiSetNotifTimestamp Bug: T134387 Change-Id: I560ae6a29fa27c1e4f1f62aa647e14542b0cc8a9 --- 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 */