Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/calendar/query/PhabricatorCalendarExternalInviteeQuery.php
12256 views
1
<?php
2
3
final class PhabricatorCalendarExternalInviteeQuery
4
extends PhabricatorCursorPagedPolicyAwareQuery {
5
6
private $ids;
7
private $phids;
8
private $names;
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 withNames(array $names) {
21
$this->names = $names;
22
return $this;
23
}
24
25
public function newResultObject() {
26
return new PhabricatorCalendarExternalInvitee();
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
'id IN (%Ld)',
36
$this->ids);
37
}
38
39
if ($this->phids !== null) {
40
$where[] = qsprintf(
41
$conn,
42
'phid IN (%Ls)',
43
$this->phids);
44
}
45
46
if ($this->names !== null) {
47
$name_indexes = array();
48
foreach ($this->names as $name) {
49
$name_indexes[] = PhabricatorHash::digestForIndex($name);
50
}
51
$where[] = qsprintf(
52
$conn,
53
'nameIndex IN (%Ls)',
54
$name_indexes);
55
}
56
57
return $where;
58
}
59
60
public function getQueryApplicationClass() {
61
return 'PhabricatorCalendarApplication';
62
}
63
64
}
65
66