Differential D16189 Diff 38944 src/applications/search/controller/PhabricatorSearchBaseController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/search/controller/PhabricatorSearchBaseController.php
<?php | <?php | ||||
abstract class PhabricatorSearchBaseController extends PhabricatorController { | abstract class PhabricatorSearchBaseController extends PhabricatorController { | ||||
const ACTION_ATTACH = 'attach'; | const ACTION_ATTACH = 'attach'; | ||||
const ACTION_MERGE = 'merge'; | const ACTION_MERGE = 'merge'; | ||||
const ACTION_DEPENDENCIES = 'dependencies'; | const ACTION_DEPENDENCIES = 'dependencies'; | ||||
const ACTION_BLOCKS = 'blocks'; | const ACTION_BLOCKS = 'blocks'; | ||||
const ACTION_EDGE = 'edge'; | const ACTION_EDGE = 'edge'; | ||||
protected function loadRelationshipObject() { | |||||
$request = $this->getRequest(); | |||||
$viewer = $this->getViewer(); | |||||
$phid = $request->getURIData('sourcePHID'); | |||||
return id(new PhabricatorObjectQuery()) | |||||
->setViewer($viewer) | |||||
->withPHIDs(array($phid)) | |||||
->requireCapabilities( | |||||
array( | |||||
PhabricatorPolicyCapability::CAN_VIEW, | |||||
PhabricatorPolicyCapability::CAN_EDIT, | |||||
)) | |||||
->executeOne(); | |||||
} | |||||
protected function loadRelationship($object) { | |||||
$request = $this->getRequest(); | |||||
$viewer = $this->getViewer(); | |||||
$relationship_key = $request->getURIData('relationshipKey'); | |||||
$list = PhabricatorObjectRelationshipList::newForObject( | |||||
$viewer, | |||||
$object); | |||||
return $list->getRelationship($relationship_key); | |||||
} | |||||
} | } |