diff --git a/src/applications/flag/query/PhabricatorFlagQuery.php b/src/applications/flag/query/PhabricatorFlagQuery.php --- a/src/applications/flag/query/PhabricatorFlagQuery.php +++ b/src/applications/flag/query/PhabricatorFlagQuery.php @@ -6,6 +6,7 @@ const GROUP_COLOR = 'color'; const GROUP_NONE = 'none'; + private $ids; private $ownerPHIDs; private $types; private $objectPHIDs; @@ -15,6 +16,11 @@ private $needHandles; private $needObjects; + public function withIDs(array $ids) { + $this->ids = $ids; + return $this; + } + public function withOwnerPHIDs(array $owner_phids) { $this->ownerPHIDs = $owner_phids; return $this; @@ -126,6 +132,13 @@ protected function buildWhereClause(AphrontDatabaseConnection $conn) { $where = array(); + if ($this->ids !== null) { + $where[] = qsprintf( + $conn, + 'flag.id IN (%Ld)', + $this->ids); + } + if ($this->ownerPHIDs) { $where[] = qsprintf( $conn,