Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/edges/conduit/EdgeSearchConduitAPIMethod.php
<?php | <?php | ||||
final class EdgeSearchConduitAPIMethod | final class EdgeSearchConduitAPIMethod | ||||
extends ConduitAPIMethod { | extends ConduitAPIMethod { | ||||
public function getAPIMethodName() { | public function getAPIMethodName() { | ||||
return 'edge.search'; | return 'edge.search'; | ||||
} | } | ||||
public function getMethodDescription() { | public function getMethodDescription() { | ||||
return pht('Read edge relationships between objects.'); | return pht('Read edge relationships between objects.'); | ||||
} | } | ||||
public function getMethodDocumentation() { | protected function newDocumentationPages(PhabricatorUser $viewer) { | ||||
$viewer = $this->getViewer(); | |||||
$rows = array(); | $rows = array(); | ||||
foreach ($this->getConduitEdgeTypeMap() as $key => $type) { | foreach ($this->getConduitEdgeTypeMap() as $key => $type) { | ||||
$inverse_constant = $type->getInverseEdgeConstant(); | $inverse_constant = $type->getInverseEdgeConstant(); | ||||
if ($inverse_constant) { | if ($inverse_constant) { | ||||
$inverse_type = PhabricatorEdgeType::getByConstant($inverse_constant); | $inverse_type = PhabricatorEdgeType::getByConstant($inverse_constant); | ||||
$inverse = $inverse_type->getConduitKey(); | $inverse = $inverse_type->getConduitKey(); | ||||
} else { | } else { | ||||
$inverse = null; | $inverse = null; | ||||
Show All 18 Lines | $types_table = id(new AphrontTableView($rows)) | ||||
->setColumnClasses( | ->setColumnClasses( | ||||
array( | array( | ||||
'mono', | 'mono', | ||||
'pri', | 'pri', | ||||
'mono', | 'mono', | ||||
'wide', | 'wide', | ||||
)); | )); | ||||
return id(new PHUIObjectBoxView()) | |||||
->setHeaderText(pht('Edge Types')) | |||||
->setTable($types_table); | |||||
} | |||||
public function getMethodStatus() { | |||||
return self::METHOD_STATUS_UNSTABLE; | |||||
} | |||||
public function getMethodStatusDescription() { | return array( | ||||
return pht('This method is new and experimental.'); | $this->newDocumentationBoxPage($viewer, pht('Edge Types'), $types_table) | ||||
->setAnchor('types'), | |||||
); | |||||
} | } | ||||
protected function defineParamTypes() { | protected function defineParamTypes() { | ||||
return array( | return array( | ||||
'sourcePHIDs' => 'list<phid>', | 'sourcePHIDs' => 'list<phid>', | ||||
'types' => 'list<const>', | 'types' => 'list<const>', | ||||
'destinationPHIDs' => 'optional list<phid>', | 'destinationPHIDs' => 'optional list<phid>', | ||||
) + $this->getPagerParamTypes(); | ) + $this->getPagerParamTypes(); | ||||
▲ Show 20 Lines • Show All 104 Lines • Show Last 20 Lines |