Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/auth/query/PhabricatorAuthContactNumberQuery.php
12262 views
1
<?php
2
3
final class PhabricatorAuthContactNumberQuery
4
extends PhabricatorCursorPagedPolicyAwareQuery {
5
6
private $ids;
7
private $phids;
8
private $objectPHIDs;
9
private $statuses;
10
private $uniqueKeys;
11
private $isPrimary;
12
13
public function withIDs(array $ids) {
14
$this->ids = $ids;
15
return $this;
16
}
17
18
public function withPHIDs(array $phids) {
19
$this->phids = $phids;
20
return $this;
21
}
22
23
public function withObjectPHIDs(array $object_phids) {
24
$this->objectPHIDs = $object_phids;
25
return $this;
26
}
27
28
public function withStatuses(array $statuses) {
29
$this->statuses = $statuses;
30
return $this;
31
}
32
33
public function withUniqueKeys(array $unique_keys) {
34
$this->uniqueKeys = $unique_keys;
35
return $this;
36
}
37
38
public function withIsPrimary($is_primary) {
39
$this->isPrimary = $is_primary;
40
return $this;
41
}
42
43
public function newResultObject() {
44
return new PhabricatorAuthContactNumber();
45
}
46
47
protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {
48
$where = parent::buildWhereClauseParts($conn);
49
50
if ($this->ids !== null) {
51
$where[] = qsprintf(
52
$conn,
53
'id IN (%Ld)',
54
$this->ids);
55
}
56
57
if ($this->phids !== null) {
58
$where[] = qsprintf(
59
$conn,
60
'phid IN (%Ls)',
61
$this->phids);
62
}
63
64
if ($this->objectPHIDs !== null) {
65
$where[] = qsprintf(
66
$conn,
67
'objectPHID IN (%Ls)',
68
$this->objectPHIDs);
69
}
70
71
if ($this->statuses !== null) {
72
$where[] = qsprintf(
73
$conn,
74
'status IN (%Ls)',
75
$this->statuses);
76
}
77
78
if ($this->uniqueKeys !== null) {
79
$where[] = qsprintf(
80
$conn,
81
'uniqueKey IN (%Ls)',
82
$this->uniqueKeys);
83
}
84
85
if ($this->isPrimary !== null) {
86
$where[] = qsprintf(
87
$conn,
88
'isPrimary = %d',
89
(int)$this->isPrimary);
90
}
91
92
return $where;
93
}
94
95
public function getQueryApplicationClass() {
96
return 'PhabricatorAuthApplication';
97
}
98
99
}
100
101