2013-11-07 02:00:09 +01:00
|
|
|
<?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;
|
|
|
|
}
|
|
|
|
|
2016-03-08 00:24:59 +01:00
|
|
|
public function newResultObject() {
|
|
|
|
return new NuanceQueue();
|
|
|
|
}
|
|
|
|
|
2015-01-13 20:56:07 +01:00
|
|
|
protected function loadPage() {
|
2016-03-08 00:24:59 +01:00
|
|
|
return $this->loadStandardPage($this->newResultObject());
|
2013-11-07 02:00:09 +01:00
|
|
|
}
|
|
|
|
|
2015-06-05 19:43:37 +02:00
|
|
|
protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {
|
|
|
|
$where = parent::buildWhereClauseParts($conn);
|
2013-11-07 02:00:09 +01:00
|
|
|
|
2015-06-05 19:43:37 +02:00
|
|
|
if ($this->ids !== null) {
|
2013-11-07 02:00:09 +01:00
|
|
|
$where[] = qsprintf(
|
2015-06-05 19:43:37 +02:00
|
|
|
$conn,
|
2013-11-07 02:00:09 +01:00
|
|
|
'id IN (%Ld)',
|
|
|
|
$this->ids);
|
|
|
|
}
|
|
|
|
|
2015-06-05 19:43:37 +02:00
|
|
|
if ($this->phids !== null) {
|
2013-11-07 02:00:09 +01:00
|
|
|
$where[] = qsprintf(
|
2015-06-05 19:43:37 +02:00
|
|
|
$conn,
|
2013-11-07 02:00:09 +01:00
|
|
|
'phid IN (%Ls)',
|
|
|
|
$this->phids);
|
|
|
|
}
|
|
|
|
|
2015-06-05 19:43:37 +02:00
|
|
|
return $where;
|
2013-11-07 02:00:09 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|