Remove all "FileHasObject" edge reads and writes
[phabricator.git] / src / applications / config / query / PhabricatorConfigEntryQuery.php
blobf46fdb7d1ee244f6f8ee86d84db1dd1301bb3ad2
1 <?php
3 final class PhabricatorConfigEntryQuery
4 extends PhabricatorCursorPagedPolicyAwareQuery {
6 private $phids;
7 private $ids;
9 public function withIDs($ids) {
10 $this->ids = $ids;
11 return $this;
14 public function withPHIDs($phids) {
15 $this->phids = $phids;
16 return $this;
19 protected function loadPage() {
20 $table = new PhabricatorConfigEntry();
21 $conn_r = $table->establishConnection('r');
23 $data = queryfx_all(
24 $conn_r,
25 'SELECT * FROM %T %Q %Q %Q',
26 $table->getTableName(),
27 $this->buildWhereClause($conn_r),
28 $this->buildOrderClause($conn_r),
29 $this->buildLimitClause($conn_r));
31 return $table->loadAllFromArray($data);
34 protected function buildWhereClause(AphrontDatabaseConnection $conn) {
35 $where = array();
37 if ($this->ids !== null) {
38 $where[] = qsprintf(
39 $conn,
40 'id IN (%Ld)',
41 $this->ids);
44 if ($this->phids !== null) {
45 $where[] = qsprintf(
46 $conn,
47 'phid IN (%Ls)',
48 $this->phids);
51 $where[] = $this->buildPagingClause($conn);
53 return $this->formatWhereClause($conn, $where);
56 public function getQueryApplicationClass() {
57 return 'PhabricatorConfigApplication';