Differential D21696 Diff 51659 src/applications/transactions/conduit/TransactionSearchConduitAPIMethod.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/conduit/TransactionSearchConduitAPIMethod.php
<?php | <?php | ||||
final class TransactionSearchConduitAPIMethod | final class TransactionSearchConduitAPIMethod | ||||
extends ConduitAPIMethod { | extends ConduitAPIMethod { | ||||
public function getAPIMethodName() { | public function getAPIMethodName() { | ||||
return 'transaction.search'; | return 'transaction.search'; | ||||
} | } | ||||
public function getMethodDescription() { | public function getMethodDescription() { | ||||
return pht( | return pht( | ||||
'Read transactions and comments for a particular object '. | 'Read transactions and comments for a particular object '. | ||||
'or an entire object type.'); | 'or an entire object type.'); | ||||
} | } | ||||
public function getMethodDocumentation() { | protected function newDocumentationPages(PhabricatorUser $viewer) { | ||||
$markup = pht(<<<EOREMARKUP | $markup = pht(<<<EOREMARKUP | ||||
When an object (like a task) is edited, Phabricator creates a "transaction" | When an object (like a task) is edited, Phabricator creates a "transaction" | ||||
and applies it. This list of transactions on each object is the basis for | and applies it. This list of transactions on each object is the basis for | ||||
essentially all edits and comments in Phabricator. Reviewing the transaction | essentially all edits and comments in Phabricator. Reviewing the transaction | ||||
record allows you to see who edited an object, when, and how their edit changed | record allows you to see who edited an object, when, and how their edit changed | ||||
things. | things. | ||||
One common reason to call this method is that you're implmenting a webhook and | One common reason to call this method is that you're implmenting a webhook and | ||||
▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | |||||
New transactions are exposed (with correctly spelled, comprehensible types and | New transactions are exposed (with correctly spelled, comprehensible types and | ||||
useful, reasonable fields) as we become aware of use cases for them. | useful, reasonable fields) as we become aware of use cases for them. | ||||
EOREMARKUP | EOREMARKUP | ||||
); | ); | ||||
$markup = $this->newRemarkupDocumentationView($markup); | $markup = $this->newRemarkupDocumentationView($markup); | ||||
return id(new PHUIObjectBoxView()) | return array( | ||||
->setCollapsed(true) | $this->newDocumentationBoxPage($viewer, pht('Method Details'), $markup) | ||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | ->setAnchor('details'), | ||||
->setHeaderText(pht('Method Details')) | ); | ||||
->appendChild($markup); | |||||
} | } | ||||
protected function defineParamTypes() { | protected function defineParamTypes() { | ||||
return array( | return array( | ||||
'objectIdentifier' => 'optional phid|string', | 'objectIdentifier' => 'optional phid|string', | ||||
'objectType' => 'optional string', | 'objectType' => 'optional string', | ||||
'constraints' => 'optional map<string, wild>', | 'constraints' => 'optional map<string, wild>', | ||||
) + $this->getPagerParamTypes(); | ) + $this->getPagerParamTypes(); | ||||
▲ Show 20 Lines • Show All 326 Lines • Show Last 20 Lines |