Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/doorkeeper/query/DoorkeeperExternalObjectQuery.php
12256 views
1
<?php
2
3
final class DoorkeeperExternalObjectQuery
4
extends PhabricatorCursorPagedPolicyAwareQuery {
5
6
protected $phids;
7
protected $objectKeys;
8
9
public function withPHIDs(array $phids) {
10
$this->phids = $phids;
11
return $this;
12
}
13
14
public function withObjectKeys(array $keys) {
15
$this->objectKeys = $keys;
16
return $this;
17
}
18
19
public function newResultObject() {
20
return new DoorkeeperExternalObject();
21
}
22
23
protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {
24
$where = parent::buildWhereClauseParts($conn);
25
26
if ($this->phids !== null) {
27
$where[] = qsprintf(
28
$conn,
29
'phid IN (%Ls)',
30
$this->phids);
31
}
32
33
if ($this->objectKeys !== null) {
34
$where[] = qsprintf(
35
$conn,
36
'objectKey IN (%Ls)',
37
$this->objectKeys);
38
}
39
40
return $where;
41
}
42
43
public function getQueryApplicationClass() {
44
return 'PhabricatorDoorkeeperApplication';
45
}
46
47
}
48
49