Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/calendar/query/PhabricatorCalendarExportQuery.php
12256 views
1
<?php
2
3
final class PhabricatorCalendarExportQuery
4
extends PhabricatorCursorPagedPolicyAwareQuery {
5
6
private $ids;
7
private $phids;
8
private $authorPHIDs;
9
private $secretKeys;
10
private $isDisabled;
11
12
public function withIDs(array $ids) {
13
$this->ids = $ids;
14
return $this;
15
}
16
17
public function withPHIDs(array $phids) {
18
$this->phids = $phids;
19
return $this;
20
}
21
22
public function withAuthorPHIDs(array $phids) {
23
$this->authorPHIDs = $phids;
24
return $this;
25
}
26
27
public function withIsDisabled($is_disabled) {
28
$this->isDisabled = $is_disabled;
29
return $this;
30
}
31
32
public function withSecretKeys(array $keys) {
33
$this->secretKeys = $keys;
34
return $this;
35
}
36
37
public function newResultObject() {
38
return new PhabricatorCalendarExport();
39
}
40
41
protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {
42
$where = parent::buildWhereClauseParts($conn);
43
44
if ($this->ids !== null) {
45
$where[] = qsprintf(
46
$conn,
47
'export.id IN (%Ld)',
48
$this->ids);
49
}
50
51
if ($this->phids !== null) {
52
$where[] = qsprintf(
53
$conn,
54
'export.phid IN (%Ls)',
55
$this->phids);
56
}
57
58
if ($this->authorPHIDs !== null) {
59
$where[] = qsprintf(
60
$conn,
61
'export.authorPHID IN (%Ls)',
62
$this->authorPHIDs);
63
}
64
65
if ($this->isDisabled !== null) {
66
$where[] = qsprintf(
67
$conn,
68
'export.isDisabled = %d',
69
(int)$this->isDisabled);
70
}
71
72
if ($this->secretKeys !== null) {
73
$where[] = qsprintf(
74
$conn,
75
'export.secretKey IN (%Ls)',
76
$this->secretKeys);
77
}
78
79
return $where;
80
}
81
82
protected function getPrimaryTableAlias() {
83
return 'export';
84
}
85
86
public function getQueryApplicationClass() {
87
return 'PhabricatorCalendarApplication';
88
}
89
90
}
91
92