Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / fund / query / FundInitiativeQuery.php
blobbbb4ef27464bd02999e6f0c50dca07eed836e6fb
1 <?php
3 final class FundInitiativeQuery
4 extends PhabricatorCursorPagedPolicyAwareQuery {
6 private $ids;
7 private $phids;
8 private $ownerPHIDs;
9 private $statuses;
11 public function withIDs(array $ids) {
12 $this->ids = $ids;
13 return $this;
16 public function withPHIDs(array $phids) {
17 $this->phids = $phids;
18 return $this;
21 public function withOwnerPHIDs(array $phids) {
22 $this->ownerPHIDs = $phids;
23 return $this;
26 public function withStatuses(array $statuses) {
27 $this->statuses = $statuses;
28 return $this;
31 public function newResultObject() {
32 return new FundInitiative();
35 protected function loadPage() {
36 return $this->loadStandardPage($this->newResultObject());
39 protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {
40 $where = parent::buildWhereClauseParts($conn);
42 if ($this->ids !== null) {
43 $where[] = qsprintf(
44 $conn,
45 'i.id IN (%Ld)',
46 $this->ids);
49 if ($this->phids !== null) {
50 $where[] = qsprintf(
51 $conn,
52 'i.phid IN (%Ls)',
53 $this->phids);
56 if ($this->ownerPHIDs !== null) {
57 $where[] = qsprintf(
58 $conn,
59 'i.ownerPHID IN (%Ls)',
60 $this->ownerPHIDs);
63 if ($this->statuses !== null) {
64 $where[] = qsprintf(
65 $conn,
66 'i.status IN (%Ls)',
67 $this->statuses);
70 return $where;
73 public function getQueryApplicationClass() {
74 return 'PhabricatorFundApplication';
77 protected function getPrimaryTableAlias() {
78 return 'i';