Differential D21227 Diff 50563 src/applications/differential/query/DifferentialDiffInlineCommentQuery.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/query/DifferentialDiffInlineCommentQuery.php
<?php | <?php | ||||
final class DifferentialDiffInlineCommentQuery | final class DifferentialDiffInlineCommentQuery | ||||
extends PhabricatorDiffInlineCommentQuery { | extends PhabricatorDiffInlineCommentQuery { | ||||
private $revisionPHIDs; | private $revisionPHIDs; | ||||
protected function newApplicationTransactionCommentTemplate() { | |||||
return new DifferentialTransactionComment(); | |||||
} | |||||
public function withRevisionPHIDs(array $phids) { | public function withRevisionPHIDs(array $phids) { | ||||
$this->revisionPHIDs = $phids; | $this->revisionPHIDs = $phids; | ||||
return $this; | return $this; | ||||
} | } | ||||
protected function getTemplate() { | public function withObjectPHIDs(array $phids) { | ||||
return new DifferentialTransactionComment(); | return $this->withRevisionPHIDs($phids); | ||||
} | |||||
protected function buildInlineCommentWhereClauseParts( | |||||
AphrontDatabaseConnection $conn) { | |||||
$where = array(); | |||||
$alias = $this->getPrimaryTableAlias(); | |||||
$where[] = qsprintf( | |||||
$conn, | |||||
'changesetID IS NOT NULL'); | |||||
return $where; | |||||
} | } | ||||
protected function buildWhereClauseComponents( | protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) { | ||||
AphrontDatabaseConnection $conn_r) { | $where = parent::buildWhereClauseParts($conn); | ||||
$where = parent::buildWhereClauseComponents($conn_r); | $alias = $this->getPrimaryTableAlias(); | ||||
if ($this->revisionPHIDs !== null) { | if ($this->revisionPHIDs !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'revisionPHID IN (%Ls)', | '%T.revisionPHID IN (%Ls)', | ||||
$alias, | |||||
$this->revisionPHIDs); | $this->revisionPHIDs); | ||||
} | } | ||||
return $where; | return $where; | ||||
} | } | ||||
} | } |