Files
phabricator/src/applications/diffusion/query/DiffusionDiffInlineCommentQuery.php
epriestley d2d7e7f5ff Clean up Diffusion behaviors for inline edit suggestions
Summary: Ref T13513. For now, I'm not supporting inline edit suggestions in Diffusion, although it's likely not difficult to do so in the future. Clean up some of the code so that plain ol' inlines work the same way they did before.

Test Plan:
  - Created, edited, reloaded, submitted inlines in Diffusion: familiar old behavior.
  - Created, edited, reloaded, submitted inlines with suggestions in Differential: familiar new behavior.

Maniphest Tasks: T13513

Differential Revision: https://secure.phabricator.com/D21278
2020-05-20 14:28:12 -07:00

74 lines
1.5 KiB
PHP

<?php
final class DiffusionDiffInlineCommentQuery
extends PhabricatorDiffInlineCommentQuery {
private $commitPHIDs;
private $pathIDs;
protected function newApplicationTransactionCommentTemplate() {
return new PhabricatorAuditTransactionComment();
}
public function withCommitPHIDs(array $phids) {
$this->commitPHIDs = $phids;
return $this;
}
public function withObjectPHIDs(array $phids) {
return $this->withCommitPHIDs($phids);
}
public function withPathIDs(array $path_ids) {
$this->pathIDs = $path_ids;
return $this;
}
protected function buildInlineCommentWhereClauseParts(
AphrontDatabaseConnection $conn) {
$where = array();
$alias = $this->getPrimaryTableAlias();
$where[] = qsprintf(
$conn,
'%T.pathID IS NOT NULL',
$alias);
return $where;
}
protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {
$where = parent::buildWhereClauseParts($conn);
$alias = $this->getPrimaryTableAlias();
if ($this->commitPHIDs !== null) {
$where[] = qsprintf(
$conn,
'%T.commitPHID IN (%Ls)',
$alias,
$this->commitPHIDs);
}
if ($this->pathIDs !== null) {
$where[] = qsprintf(
$conn,
'%T.pathID IN (%Ld)',
$alias,
$this->pathIDs);
}
return $where;
}
protected function loadHiddenCommentIDs(
$viewer_phid,
array $comments) {
return array();
}
protected function newInlineContextMap(array $inlines) {
return array();
}
}