@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3/**
4 * @extends PhabricatorCursorPagedPolicyAwareQuery<DoorkeeperExternalObject>
5 */
6final class DoorkeeperExternalObjectQuery
7 extends PhabricatorCursorPagedPolicyAwareQuery {
8
9 protected $phids;
10 protected $objectKeys;
11
12 public function withPHIDs(array $phids) {
13 $this->phids = $phids;
14 return $this;
15 }
16
17 public function withObjectKeys(array $keys) {
18 $this->objectKeys = $keys;
19 return $this;
20 }
21
22 public function newResultObject() {
23 return new DoorkeeperExternalObject();
24 }
25
26 protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {
27 $where = parent::buildWhereClauseParts($conn);
28
29 if ($this->phids !== null) {
30 $where[] = qsprintf(
31 $conn,
32 'phid IN (%Ls)',
33 $this->phids);
34 }
35
36 if ($this->objectKeys !== null) {
37 $where[] = qsprintf(
38 $conn,
39 'objectKey IN (%Ls)',
40 $this->objectKeys);
41 }
42
43 return $where;
44 }
45
46 public function getQueryApplicationClass() {
47 return PhabricatorDoorkeeperApplication::class;
48 }
49
50}