Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phragment/query/PhragmentFragmentQuery.php
Show First 20 Lines • Show All 49 Lines • ▼ Show 20 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) { | ||||
$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 ($this->paths) { | if ($this->paths) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'path IN (%Ls)', | 'path IN (%Ls)', | ||||
$this->paths); | $this->paths); | ||||
} | } | ||||
if ($this->leadingPath) { | if ($this->leadingPath) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'path LIKE %>', | 'path LIKE %>', | ||||
$this->leadingPath); | $this->leadingPath); | ||||
} | } | ||||
if ($this->depths) { | if ($this->depths) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'depth IN (%Ld)', | 'depth IN (%Ld)', | ||||
$this->depths); | $this->depths); | ||||
} | } | ||||
$where[] = $this->buildPagingClause($conn_r); | $where[] = $this->buildPagingClause($conn); | ||||
return $this->formatWhereClause($where); | return $this->formatWhereClause($conn, $where); | ||||
} | } | ||||
protected function didFilterPage(array $page) { | protected function didFilterPage(array $page) { | ||||
if ($this->needLatestVersion) { | if ($this->needLatestVersion) { | ||||
$versions = array(); | $versions = array(); | ||||
$version_phids = array_filter(mpull($page, 'getLatestVersionPHID')); | $version_phids = array_filter(mpull($page, 'getLatestVersionPHID')); | ||||
if ($version_phids) { | if ($version_phids) { | ||||
Show All 24 Lines |