Differential D19047 Diff 45671 src/applications/transactions/conduit/TransactionSearchConduitAPIMethod.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/conduit/TransactionSearchConduitAPIMethod.php
| Show All 16 Lines | final class TransactionSearchConduitAPIMethod | ||||
| public function getMethodStatusDescription() { | public function getMethodStatusDescription() { | ||||
| return pht('This method is new and experimental.'); | return pht('This method is new and experimental.'); | ||||
| } | } | ||||
| protected function defineParamTypes() { | protected function defineParamTypes() { | ||||
| return array( | return array( | ||||
| 'objectIdentifier' => 'phid|string', | 'objectIdentifier' => 'phid|string', | ||||
| 'constraints' => 'map<string, wild>', | |||||
| ) + $this->getPagerParamTypes(); | ) + $this->getPagerParamTypes(); | ||||
| } | } | ||||
| protected function defineReturnType() { | protected function defineReturnType() { | ||||
| return 'list<dict>'; | return 'list<dict>'; | ||||
| } | } | ||||
| protected function defineErrorTypes() { | protected function defineErrorTypes() { | ||||
| Show All 28 Lines | if (!($object instanceof PhabricatorApplicationTransactionInterface)) { | ||||
| pht( | pht( | ||||
| 'Object "%s" does not implement "%s", so transactions can not '. | 'Object "%s" does not implement "%s", so transactions can not '. | ||||
| 'be loaded for it.')); | 'be loaded for it.')); | ||||
| } | } | ||||
| $xaction_query = PhabricatorApplicationTransactionQuery::newQueryForObject( | $xaction_query = PhabricatorApplicationTransactionQuery::newQueryForObject( | ||||
| $object); | $object); | ||||
| $xactions = $xaction_query | $xaction_query | ||||
| ->withObjectPHIDs(array($object->getPHID())) | ->withObjectPHIDs(array($object->getPHID())) | ||||
| ->setViewer($viewer) | ->setViewer($viewer); | ||||
| ->executeWithCursorPager($pager); | |||||
| $constraints = $request->getValue('constraints', array()); | |||||
| PhutilTypeSpec::checkMap( | |||||
| $constraints, | |||||
| array( | |||||
| 'phids' => 'optional list<string>', | |||||
| )); | |||||
| $with_phids = idx($constraints, 'phids'); | |||||
| if ($with_phids) { | |||||
| $xaction_query->withPHIDs($with_phids); | |||||
| } | |||||
| $xactions = $xaction_query->executeWithCursorPager($pager); | |||||
| if ($xactions) { | if ($xactions) { | ||||
| $template = head($xactions)->getApplicationTransactionCommentObject(); | $template = head($xactions)->getApplicationTransactionCommentObject(); | ||||
| $query = new PhabricatorApplicationTransactionTemplatedCommentQuery(); | $query = new PhabricatorApplicationTransactionTemplatedCommentQuery(); | ||||
| $comment_map = $query | $comment_map = $query | ||||
| ->setViewer($viewer) | ->setViewer($viewer) | ||||
| ▲ Show 20 Lines • Show All 136 Lines • Show Last 20 Lines | |||||