Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/diffusion/query/DiffusionDiffInlineCommentQuery.php
12242 views
1
<?php
2
3
final class DiffusionDiffInlineCommentQuery
4
extends PhabricatorDiffInlineCommentQuery {
5
6
private $commitPHIDs;
7
private $pathIDs;
8
9
protected function newApplicationTransactionCommentTemplate() {
10
return new PhabricatorAuditTransactionComment();
11
}
12
13
public function withCommitPHIDs(array $phids) {
14
$this->commitPHIDs = $phids;
15
return $this;
16
}
17
18
public function withObjectPHIDs(array $phids) {
19
return $this->withCommitPHIDs($phids);
20
}
21
22
public function withPathIDs(array $path_ids) {
23
$this->pathIDs = $path_ids;
24
return $this;
25
}
26
27
protected function buildInlineCommentWhereClauseParts(
28
AphrontDatabaseConnection $conn) {
29
$where = array();
30
$alias = $this->getPrimaryTableAlias();
31
32
$where[] = qsprintf(
33
$conn,
34
'%T.pathID IS NOT NULL',
35
$alias);
36
37
return $where;
38
}
39
40
protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {
41
$where = parent::buildWhereClauseParts($conn);
42
$alias = $this->getPrimaryTableAlias();
43
44
if ($this->commitPHIDs !== null) {
45
$where[] = qsprintf(
46
$conn,
47
'%T.commitPHID IN (%Ls)',
48
$alias,
49
$this->commitPHIDs);
50
}
51
52
if ($this->pathIDs !== null) {
53
$where[] = qsprintf(
54
$conn,
55
'%T.pathID IN (%Ld)',
56
$alias,
57
$this->pathIDs);
58
}
59
60
return $where;
61
}
62
63
protected function loadHiddenCommentIDs(
64
$viewer_phid,
65
array $comments) {
66
return array();
67
}
68
69
protected function newInlineContextMap(array $inlines) {
70
return array();
71
}
72
73
protected function newInlineContextFromCacheData(array $map) {
74
return PhabricatorDiffInlineCommentContext::newFromCacheData($map);
75
}
76
77
}
78
79