Changeset View
Changeset View
Standalone View
Standalone View
src/applications/flag/query/PhabricatorFlagQuery.php
| <?php | <?php | ||||
| final class PhabricatorFlagQuery | final class PhabricatorFlagQuery | ||||
| extends PhabricatorCursorPagedPolicyAwareQuery { | extends PhabricatorCursorPagedPolicyAwareQuery { | ||||
| const GROUP_COLOR = 'color'; | const GROUP_COLOR = 'color'; | ||||
| const GROUP_NONE = 'none'; | const GROUP_NONE = 'none'; | ||||
| private $ids; | |||||
| private $ownerPHIDs; | private $ownerPHIDs; | ||||
| private $types; | private $types; | ||||
| private $objectPHIDs; | private $objectPHIDs; | ||||
| private $colors; | private $colors; | ||||
| private $groupBy = self::GROUP_NONE; | private $groupBy = self::GROUP_NONE; | ||||
| private $needHandles; | private $needHandles; | ||||
| private $needObjects; | private $needObjects; | ||||
| public function withIDs(array $ids) { | |||||
| $this->ids = $ids; | |||||
| return $this; | |||||
| } | |||||
| public function withOwnerPHIDs(array $owner_phids) { | public function withOwnerPHIDs(array $owner_phids) { | ||||
| $this->ownerPHIDs = $owner_phids; | $this->ownerPHIDs = $owner_phids; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function withTypes(array $types) { | public function withTypes(array $types) { | ||||
| $this->types = $types; | $this->types = $types; | ||||
| return $this; | return $this; | ||||
| ▲ Show 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | protected function willFilterPage(array $flags) { | ||||
| } | } | ||||
| return $flags; | return $flags; | ||||
| } | } | ||||
| protected function buildWhereClause(AphrontDatabaseConnection $conn) { | protected function buildWhereClause(AphrontDatabaseConnection $conn) { | ||||
| $where = array(); | $where = array(); | ||||
| if ($this->ids !== null) { | |||||
| $where[] = qsprintf( | |||||
| $conn, | |||||
| 'flag.id IN (%Ld)', | |||||
| $this->ids); | |||||
| } | |||||
| if ($this->ownerPHIDs) { | if ($this->ownerPHIDs) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn, | $conn, | ||||
| 'flag.ownerPHID IN (%Ls)', | 'flag.ownerPHID IN (%Ls)', | ||||
| $this->ownerPHIDs); | $this->ownerPHIDs); | ||||
| } | } | ||||
| if ($this->types) { | if ($this->types) { | ||||
| Show All 30 Lines | |||||