Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/packages/query/PhabricatorPackagesQuery.php
12242 views
1
<?php
2
3
abstract class PhabricatorPackagesQuery
4
extends PhabricatorCursorPagedPolicyAwareQuery {
5
6
public function getQueryApplicationClass() {
7
return 'PhabricatorPackagesApplication';
8
}
9
10
protected function buildFullKeyClauseParts(
11
AphrontDatabaseConnection $conn,
12
array $full_keys) {
13
14
$parts = array();
15
foreach ($full_keys as $full_key) {
16
$key_parts = explode('/', $full_key, 2);
17
18
if (count($key_parts) != 2) {
19
continue;
20
}
21
22
$parts[] = qsprintf(
23
$conn,
24
'(u.publisherKey = %s AND p.packageKey = %s)',
25
$key_parts[0],
26
$key_parts[1]);
27
}
28
29
// If none of the full keys we were provided were valid, we don't
30
// match any results.
31
if (!$parts) {
32
throw new PhabricatorEmptyQueryException();
33
}
34
35
return qsprintf($conn, '%LO', $parts);
36
}
37
38
}
39
40