Changeset View
Changeset View
Standalone View
Standalone View
src/applications/nuance/query/NuanceRequestorQuery.php
Show All 10 Lines | public function withIDs(array $ids) { | ||||
return $this; | return $this; | ||||
} | } | ||||
public function withPHIDs(array $phids) { | public function withPHIDs(array $phids) { | ||||
$this->phids = $phids; | $this->phids = $phids; | ||||
return $this; | return $this; | ||||
} | } | ||||
protected function loadPage() { | public function newObject() { | ||||
$table = new NuanceRequestor(); | return new NuanceRequestor(); | ||||
$conn_r = $table->establishConnection('r'); | |||||
$data = queryfx_all( | |||||
$conn_r, | |||||
'SELECT FROM %T %Q %Q %Q', | |||||
$table->getTableName(), | |||||
$this->buildWhereClause($conn_r), | |||||
$this->buildOrderClause($conn_r), | |||||
$this->buildLimitClause($conn_r)); | |||||
return $table->loadAllFromArray($data); | |||||
} | } | ||||
protected function buildWhereClause(AphrontDatabaseConnection $conn_r) { | protected function loadPage() { | ||||
$where = array(); | return $this->loadStandardPage($this->newObject()); | ||||
} | |||||
$where[] = $this->buildPagingClause($conn_r); | protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) { | ||||
$where = parent::buildWhereClauseParts($conn); | |||||
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); | ||||
} | } | ||||
return $this->formatWhereClause($where); | return $where; | ||||
} | } | ||||
} | } |