Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phragment/query/PhragmentSnapshotQuery.php
| Show All 37 Lines | $data = queryfx_all( | ||||
| $table->getTableName(), | $table->getTableName(), | ||||
| $this->buildWhereClause($conn_r), | $this->buildWhereClause($conn_r), | ||||
| $this->buildOrderClause($conn_r), | $this->buildOrderClause($conn_r), | ||||
| $this->buildLimitClause($conn_r)); | $this->buildLimitClause($conn_r)); | ||||
| return $table->loadAllFromArray($data); | return $table->loadAllFromArray($data); | ||||
| } | } | ||||
| protected function buildWhereClause(AphrontDatabaseConnection $conn_r) { | protected function buildWhereClause(AphrontDatabaseConnection $conn) { | ||||
| $where = array(); | $where = array(); | ||||
| if ($this->ids) { | if ($this->ids !== null) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn, | ||||
| 'id IN (%Ld)', | 'id IN (%Ld)', | ||||
| $this->ids); | $this->ids); | ||||
| } | } | ||||
| if ($this->phids) { | if ($this->phids !== null) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn, | ||||
| 'phid IN (%Ls)', | 'phid IN (%Ls)', | ||||
| $this->phids); | $this->phids); | ||||
| } | } | ||||
| if ($this->primaryFragmentPHIDs) { | if ($this->primaryFragmentPHIDs !== null) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn, | ||||
| 'primaryFragmentPHID IN (%Ls)', | 'primaryFragmentPHID IN (%Ls)', | ||||
| $this->primaryFragmentPHIDs); | $this->primaryFragmentPHIDs); | ||||
| } | } | ||||
| if ($this->names) { | if ($this->names !== null) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn, | ||||
| 'name IN (%Ls)', | 'name IN (%Ls)', | ||||
| $this->names); | $this->names); | ||||
| } | } | ||||
| $where[] = $this->buildPagingClause($conn_r); | $where[] = $this->buildPagingClause($conn); | ||||
| return $this->formatWhereClause($where); | return $this->formatWhereClause($conn, $where); | ||||
| } | } | ||||
| protected function willFilterPage(array $page) { | protected function willFilterPage(array $page) { | ||||
| $fragments = array(); | $fragments = array(); | ||||
| $fragment_phids = array_filter(mpull($page, 'getPrimaryFragmentPHID')); | $fragment_phids = array_filter(mpull($page, 'getPrimaryFragmentPHID')); | ||||
| if ($fragment_phids) { | if ($fragment_phids) { | ||||
| $fragments = id(new PhabricatorObjectQuery()) | $fragments = id(new PhabricatorObjectQuery()) | ||||
| Show All 24 Lines | |||||