Changeset View
Changeset View
Standalone View
Standalone View
src/applications/flag/query/PhabricatorFlagQuery.php
| Show First 20 Lines • Show All 117 Lines • ▼ Show 20 Lines | switch ($this->groupBy) { | ||||
| throw new Exception( | throw new Exception( | ||||
| pht('Unknown groupBy parameter: %s', $this->groupBy)); | pht('Unknown groupBy parameter: %s', $this->groupBy)); | ||||
| break; | break; | ||||
| } | } | ||||
| return $flags; | return $flags; | ||||
| } | } | ||||
| protected function buildWhereClause(AphrontDatabaseConnection $conn_r) { | protected function buildWhereClause(AphrontDatabaseConnection $conn) { | ||||
| $where = array(); | $where = array(); | ||||
| if ($this->ownerPHIDs) { | if ($this->ownerPHIDs) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn, | ||||
| 'flag.ownerPHID IN (%Ls)', | 'flag.ownerPHID IN (%Ls)', | ||||
| $this->ownerPHIDs); | $this->ownerPHIDs); | ||||
| } | } | ||||
| if ($this->types) { | if ($this->types) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn, | ||||
| 'flag.type IN (%Ls)', | 'flag.type IN (%Ls)', | ||||
| $this->types); | $this->types); | ||||
| } | } | ||||
| if ($this->objectPHIDs) { | if ($this->objectPHIDs) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn, | ||||
| 'flag.objectPHID IN (%Ls)', | 'flag.objectPHID IN (%Ls)', | ||||
| $this->objectPHIDs); | $this->objectPHIDs); | ||||
| } | } | ||||
| if ($this->colors) { | if ($this->colors) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn, | ||||
| 'flag.color IN (%Ld)', | 'flag.color IN (%Ld)', | ||||
| $this->colors); | $this->colors); | ||||
| } | } | ||||
| $where[] = $this->buildPagingClause($conn_r); | $where[] = $this->buildPagingClause($conn); | ||||
| return $this->formatWhereClause($where); | return $this->formatWhereClause($conn, $where); | ||||
| } | } | ||||
| public function getQueryApplicationClass() { | public function getQueryApplicationClass() { | ||||
| return 'PhabricatorFlagsApplication'; | return 'PhabricatorFlagsApplication'; | ||||
| } | } | ||||
| } | } | ||||