From 7892627ccc85778aaef9aeac2d7b16505f4cd5b8 Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Wed, 18 Jun 2014 08:07:20 +1000 Subject: [PATCH] Add a `withoutIDs` method to `PhabricatorDaemonLogQuery`. Summary: Add a method to `PhabricatorDaemonLogQuery` to exclude IDs from the results. Test Plan: Thought long and hard. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: epriestley, Korvin Differential Revision: https://secure.phabricator.com/D9606 --- .../daemon/query/PhabricatorDaemonLogQuery.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/applications/daemon/query/PhabricatorDaemonLogQuery.php b/src/applications/daemon/query/PhabricatorDaemonLogQuery.php index c3f2ddf7f0..364b9e61b5 100644 --- a/src/applications/daemon/query/PhabricatorDaemonLogQuery.php +++ b/src/applications/daemon/query/PhabricatorDaemonLogQuery.php @@ -7,6 +7,7 @@ final class PhabricatorDaemonLogQuery const STATUS_ALIVE = 'status-alive'; private $ids; + private $notIDs; private $status = self::STATUS_ALL; private $daemonClasses; private $allowStatusWrites; @@ -24,6 +25,11 @@ final class PhabricatorDaemonLogQuery return $this; } + public function withoutIDs(array $ids) { + $this->notIDs = $ids; + return $this; + } + public function withStatus($status) { $this->status = $status; return $this; @@ -119,6 +125,13 @@ final class PhabricatorDaemonLogQuery $this->ids); } + if ($this->notIDs) { + $where[] = qsprintf( + $conn_r, + 'id NOT IN (%Ld)', + $this->notIDs); + } + if ($this->getStatusConstants()) { $where[] = qsprintf( $conn_r,