Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/diff/query/PhabricatorDiffInlineCommentQuery.php
<?php | <?php | ||||
abstract class PhabricatorDiffInlineCommentQuery | abstract class PhabricatorDiffInlineCommentQuery | ||||
extends PhabricatorApplicationTransactionCommentQuery { | extends PhabricatorApplicationTransactionCommentQuery { | ||||
private $fixedStates; | private $fixedStates; | ||||
private $needReplyToComments; | private $needReplyToComments; | ||||
abstract protected function buildInlineCommentWhereClauseParts( | |||||
AphrontDatabaseConnection $conn); | |||||
abstract public function withObjectPHIDs(array $phids); | |||||
public function withFixedStates(array $states) { | public function withFixedStates(array $states) { | ||||
$this->fixedStates = $states; | $this->fixedStates = $states; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function needReplyToComments($need_reply_to) { | public function needReplyToComments($need_reply_to) { | ||||
$this->needReplyToComments = $need_reply_to; | $this->needReplyToComments = $need_reply_to; | ||||
return $this; | return $this; | ||||
} | } | ||||
protected function buildWhereClauseComponents( | protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) { | ||||
AphrontDatabaseConnection $conn_r) { | $where = parent::buildWhereClauseParts($conn); | ||||
$where = parent::buildWhereClauseComponents($conn_r); | $alias = $this->getPrimaryTableAlias(); | ||||
foreach ($this->buildInlineCommentWhereClauseParts($conn) as $part) { | |||||
$where[] = $part; | |||||
} | |||||
if ($this->fixedStates !== null) { | if ($this->fixedStates !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'fixedState IN (%Ls)', | '%T.fixedState IN (%Ls)', | ||||
$alias, | |||||
$this->fixedStates); | $this->fixedStates); | ||||
} | } | ||||
return $where; | return $where; | ||||
} | } | ||||
protected function willFilterPage(array $comments) { | protected function willFilterPage(array $comments) { | ||||
if ($this->needReplyToComments) { | if ($this->needReplyToComments) { | ||||
Show All 39 Lines |