3 final class PhluxVariableQuery
4 extends PhabricatorCursorPagedPolicyAwareQuery
{
10 public function withIDs(array $ids) {
15 public function withPHIDs(array $phids) {
16 $this->phids
= $phids;
20 public function withKeys(array $keys) {
25 protected function loadPage() {
26 $table = new PhluxVariable();
27 $conn_r = $table->establishConnection('r');
31 'SELECT * FROM %T %Q %Q %Q',
32 $table->getTableName(),
33 $this->buildWhereClause($conn_r),
34 $this->buildOrderClause($conn_r),
35 $this->buildLimitClause($conn_r));
37 return $table->loadAllFromArray($rows);
40 protected function buildWhereClause(AphrontDatabaseConnection
$conn) {
43 if ($this->ids
!== null) {
50 if ($this->keys
!== null) {
53 'variableKey IN (%Ls)',
57 if ($this->phids
!== null) {
64 $where[] = $this->buildPagingClause($conn);
66 return $this->formatWhereClause($conn, $where);
69 protected function getDefaultOrderVector() {
73 public function getOrderableColumns() {
76 'column' => 'variableKey',
84 protected function newPagingMapFromPartialObject($object) {
86 'id' => (int)$object->getID(),
87 'key' => $object->getVariableKey(),
91 public function getQueryApplicationClass() {
92 return 'PhabricatorPhluxApplication';