Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/dashboard/query/PhabricatorDashboardPortalQuery.php
12242 views
1
<?php
2
3
final class PhabricatorDashboardPortalQuery
4
extends PhabricatorCursorPagedPolicyAwareQuery {
5
6
private $ids;
7
private $phids;
8
private $statuses;
9
10
public function withIDs(array $ids) {
11
$this->ids = $ids;
12
return $this;
13
}
14
15
public function withPHIDs(array $phids) {
16
$this->phids = $phids;
17
return $this;
18
}
19
20
public function withStatuses(array $statuses) {
21
$this->statuses = $statuses;
22
return $this;
23
}
24
25
public function newResultObject() {
26
return new PhabricatorDashboardPortal();
27
}
28
29
protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {
30
$where = parent::buildWhereClauseParts($conn);
31
32
if ($this->ids !== null) {
33
$where[] = qsprintf(
34
$conn,
35
'portal.id IN (%Ld)',
36
$this->ids);
37
}
38
39
if ($this->phids !== null) {
40
$where[] = qsprintf(
41
$conn,
42
'portal.phid IN (%Ls)',
43
$this->phids);
44
}
45
46
if ($this->statuses !== null) {
47
$where[] = qsprintf(
48
$conn,
49
'portal.status IN (%Ls)',
50
$this->statuses);
51
}
52
53
return $where;
54
}
55
56
public function getQueryApplicationClass() {
57
return 'PhabricatorDashboardApplication';
58
}
59
60
protected function getPrimaryTableAlias() {
61
return 'portal';
62
}
63
64
}
65
66