Summary: Ref T8434. Touch things up a bit. This also cleans up the missing ApplicationTransactionInterface for T6367. Test Plan: Didn't create a new queue. Didn't edit an existing queue. Reviewers: btrahan Reviewed By: btrahan Subscribers: jeremyb, epriestley Maniphest Tasks: T8434 Differential Revision: https://secure.phabricator.com/D13160
56 lines
1.1 KiB
PHP
56 lines
1.1 KiB
PHP
<?php
|
|
|
|
final class NuanceQueueQuery
|
|
extends NuanceQuery {
|
|
|
|
private $ids;
|
|
private $phids;
|
|
|
|
public function withIDs(array $ids) {
|
|
$this->ids = $ids;
|
|
return $this;
|
|
}
|
|
|
|
public function withPHIDs(array $phids) {
|
|
$this->phids = $phids;
|
|
return $this;
|
|
}
|
|
|
|
protected function loadPage() {
|
|
$table = new NuanceQueue();
|
|
$conn = $table->establishConnection('r');
|
|
|
|
$data = queryfx_all(
|
|
$conn,
|
|
'%Q FROM %T %Q %Q %Q',
|
|
$this->buildSelectClause($conn),
|
|
$table->getTableName(),
|
|
$this->buildWhereClause($conn),
|
|
$this->buildOrderClause($conn),
|
|
$this->buildLimitClause($conn));
|
|
|
|
return $table->loadAllFromArray($data);
|
|
}
|
|
|
|
protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {
|
|
$where = parent::buildWhereClauseParts($conn);
|
|
|
|
if ($this->ids !== null) {
|
|
$where[] = qsprintf(
|
|
$conn,
|
|
'id IN (%Ld)',
|
|
$this->ids);
|
|
}
|
|
|
|
if ($this->phids !== null) {
|
|
$where[] = qsprintf(
|
|
$conn,
|
|
'phid IN (%Ls)',
|
|
$this->phids);
|
|
}
|
|
|
|
return $where;
|
|
}
|
|
|
|
}
|