Path: blob/master/src/applications/config/query/PhabricatorConfigEntryQuery.php
12256 views
<?php12final class PhabricatorConfigEntryQuery3extends PhabricatorCursorPagedPolicyAwareQuery {45private $phids;6private $ids;78public function withIDs($ids) {9$this->ids = $ids;10return $this;11}1213public function withPHIDs($phids) {14$this->phids = $phids;15return $this;16}1718protected function loadPage() {19$table = new PhabricatorConfigEntry();20$conn_r = $table->establishConnection('r');2122$data = queryfx_all(23$conn_r,24'SELECT * FROM %T %Q %Q %Q',25$table->getTableName(),26$this->buildWhereClause($conn_r),27$this->buildOrderClause($conn_r),28$this->buildLimitClause($conn_r));2930return $table->loadAllFromArray($data);31}3233protected function buildWhereClause(AphrontDatabaseConnection $conn) {34$where = array();3536if ($this->ids !== null) {37$where[] = qsprintf(38$conn,39'id IN (%Ld)',40$this->ids);41}4243if ($this->phids !== null) {44$where[] = qsprintf(45$conn,46'phid IN (%Ls)',47$this->phids);48}4950$where[] = $this->buildPagingClause($conn);5152return $this->formatWhereClause($conn, $where);53}5455public function getQueryApplicationClass() {56return 'PhabricatorConfigApplication';57}5859}606162