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 $needReplyToComments; | private $needReplyToComments; | ||||
| public function withFixedStates(array $states) { | |||||
| $this->fixedStates = $states; | |||||
| 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( | |||||
| AphrontDatabaseConnection $conn_r) { | |||||
| $where = parent::buildWhereClauseComponents($conn_r); | |||||
| if ($this->fixedStates !== null) { | |||||
| $where[] = qsprintf( | |||||
| $conn_r, | |||||
| 'fixedState IN (%Ls)', | |||||
| $this->fixedStates); | |||||
| } | |||||
| return $where; | |||||
| } | |||||
| protected function willFilterPage(array $comments) { | protected function willFilterPage(array $comments) { | ||||
| if ($this->needReplyToComments) { | if ($this->needReplyToComments) { | ||||
| $reply_phids = array(); | $reply_phids = array(); | ||||
| foreach ($comments as $comment) { | foreach ($comments as $comment) { | ||||
| $reply_phid = $comment->getReplyToCommentPHID(); | $reply_phid = $comment->getReplyToCommentPHID(); | ||||
| if ($reply_phid) { | if ($reply_phid) { | ||||
| $reply_phids[] = $reply_phid; | $reply_phids[] = $reply_phid; | ||||
| } | } | ||||
| Show All 33 Lines | |||||