Differential D20341 Diff 48552 src/applications/conpherence/engineextension/ConpherenceThreadIndexEngineExtension.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conpherence/engineextension/ConpherenceThreadIndexEngineExtension.php
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | foreach ($xactions as $xaction) { | ||||
$this->indexComment($object, $xaction); | $this->indexComment($object, $xaction); | ||||
} | } | ||||
} | } | ||||
private function indexComment( | private function indexComment( | ||||
ConpherenceThread $thread, | ConpherenceThread $thread, | ||||
ConpherenceTransaction $xaction) { | ConpherenceTransaction $xaction) { | ||||
$previous = id(new ConpherenceTransactionQuery()) | $pager = id(new AphrontCursorPagerView()) | ||||
->setPageSize(1) | |||||
->setAfterID($xaction->getID()); | |||||
$previous_xactions = id(new ConpherenceTransactionQuery()) | |||||
->setViewer($this->getViewer()) | ->setViewer($this->getViewer()) | ||||
->withObjectPHIDs(array($thread->getPHID())) | ->withObjectPHIDs(array($thread->getPHID())) | ||||
->withTransactionTypes(array(PhabricatorTransactions::TYPE_COMMENT)) | ->withTransactionTypes(array(PhabricatorTransactions::TYPE_COMMENT)) | ||||
->setAfterID($xaction->getID()) | ->executeWithCursorPager($pager); | ||||
->setLimit(1) | $previous = head($previous_xactions); | ||||
->executeOne(); | |||||
$index = id(new ConpherenceIndex()) | $index = id(new ConpherenceIndex()) | ||||
->setThreadPHID($thread->getPHID()) | ->setThreadPHID($thread->getPHID()) | ||||
->setTransactionPHID($xaction->getPHID()) | ->setTransactionPHID($xaction->getPHID()) | ||||
->setPreviousTransactionPHID($previous ? $previous->getPHID() : null) | ->setPreviousTransactionPHID($previous ? $previous->getPHID() : null) | ||||
->setCorpus($xaction->getComment()->getContent()); | ->setCorpus($xaction->getComment()->getContent()); | ||||
queryfx( | queryfx( | ||||
Show All 13 Lines |