Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diviner/query/DivinerBookQuery.php
| Show First 20 Lines • Show All 110 Lines • ▼ Show 20 Lines | if ($this->needProjectPHIDs) { | ||||
| )); | )); | ||||
| $book->attachProjectPHIDs($project_phids); | $book->attachProjectPHIDs($project_phids); | ||||
| } | } | ||||
| } | } | ||||
| return $books; | return $books; | ||||
| } | } | ||||
| protected function buildWhereClause(AphrontDatabaseConnection $conn_r) { | protected function buildWhereClause(AphrontDatabaseConnection $conn) { | ||||
| $where = array(); | $where = array(); | ||||
| if ($this->ids) { | if ($this->ids) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn, | ||||
| 'id IN (%Ld)', | 'id IN (%Ld)', | ||||
| $this->ids); | $this->ids); | ||||
| } | } | ||||
| if ($this->phids) { | if ($this->phids) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn, | ||||
| 'phid IN (%Ls)', | 'phid IN (%Ls)', | ||||
| $this->phids); | $this->phids); | ||||
| } | } | ||||
| if (strlen($this->nameLike)) { | if (strlen($this->nameLike)) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn, | ||||
| 'name LIKE %~', | 'name LIKE %~', | ||||
| $this->nameLike); | $this->nameLike); | ||||
| } | } | ||||
| if ($this->names !== null) { | if ($this->names !== null) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn, | ||||
| 'name IN (%Ls)', | 'name IN (%Ls)', | ||||
| $this->names); | $this->names); | ||||
| } | } | ||||
| if (strlen($this->namePrefix)) { | if (strlen($this->namePrefix)) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn, | ||||
| 'name LIKE %>', | 'name LIKE %>', | ||||
| $this->namePrefix); | $this->namePrefix); | ||||
| } | } | ||||
| if ($this->repositoryPHIDs !== null) { | if ($this->repositoryPHIDs !== null) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn, | ||||
| 'repositoryPHID IN (%Ls)', | 'repositoryPHID IN (%Ls)', | ||||
| $this->repositoryPHIDs); | $this->repositoryPHIDs); | ||||
| } | } | ||||
| $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 'PhabricatorDivinerApplication'; | return 'PhabricatorDivinerApplication'; | ||||
| } | } | ||||
| public function getOrderableColumns() { | public function getOrderableColumns() { | ||||
| return parent::getOrderableColumns() + array( | return parent::getOrderableColumns() + array( | ||||
| Show All 27 Lines | |||||