From: addshore Date: Mon, 12 Feb 2018 12:22:03 +0000 (+0000) Subject: Add clearUserWatchedItems methods to WatchedItemStoreInterface X-Git-Tag: 1.31.0-rc.0~620^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/?a=commitdiff_plain;h=536a4afbffc9728879d2cc039eb7a28acfd6c3e5;p=lhc%2Fweb%2Fwiklou.git Add clearUserWatchedItems methods to WatchedItemStoreInterface Follows up to 6cf900ffb0bec584e64202bc3. The main implementation of these methods was merged, but the method signatures were not added to the interface, nor to the other implementations of that interface (NoWrite*). I would have expected phan to spot this, if we were not skipping so many of its checks. Change-Id: I169d0312e9022d0d3b31d2424ec62dd9978f03bb --- diff --git a/includes/watcheditem/NoWriteWatchedItemStore.php b/includes/watcheditem/NoWriteWatchedItemStore.php index 1439421037..1a0f504714 100644 --- a/includes/watcheditem/NoWriteWatchedItemStore.php +++ b/includes/watcheditem/NoWriteWatchedItemStore.php @@ -131,4 +131,11 @@ class NoWriteWatchedItemStore implements WatchedItemStoreInterface { throw new DBReadOnlyError( null, 'The watchlist is currently readonly.' ); } + public function clearUserWatchedItems( User $user ) { + throw new DBReadOnlyError( null, 'The watchlist is currently readonly.' ); + } + + public function clearUserWatchedItemsUsingJobQueue( User $user ) { + throw new DBReadOnlyError( null, 'The watchlist is currently readonly.' ); + } } diff --git a/includes/watcheditem/WatchedItemStoreInterface.php b/includes/watcheditem/WatchedItemStoreInterface.php index d5a3d7ca4b..133f480cdf 100644 --- a/includes/watcheditem/WatchedItemStoreInterface.php +++ b/includes/watcheditem/WatchedItemStoreInterface.php @@ -288,4 +288,22 @@ interface WatchedItemStoreInterface { */ public function duplicateEntry( LinkTarget $oldTarget, LinkTarget $newTarget ); + /** + * Queues a job that will clear the users watchlist using the Job Queue. + * + * @since 1.31 + * + * @param User $user + */ + public function clearUserWatchedItems( User $user ); + + /** + * Queues a job that will clear the users watchlist using the Job Queue. + * + * @since 1.31 + * + * @param User $user + */ + public function clearUserWatchedItemsUsingJobQueue( User $user ); + }