Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / search / controller / PhabricatorSearchBaseController.php
blobd3f31c1e6a896fe920d4491c8664acffa302f1c4
1 <?php
3 abstract class PhabricatorSearchBaseController extends PhabricatorController {
5 protected function loadRelationshipObject() {
6 $request = $this->getRequest();
7 $viewer = $this->getViewer();
9 $phid = $request->getURIData('sourcePHID');
11 return id(new PhabricatorObjectQuery())
12 ->setViewer($viewer)
13 ->withPHIDs(array($phid))
14 ->requireCapabilities(
15 array(
16 PhabricatorPolicyCapability::CAN_VIEW,
17 PhabricatorPolicyCapability::CAN_EDIT,
19 ->executeOne();
22 protected function loadRelationship($object) {
23 $request = $this->getRequest();
24 $viewer = $this->getViewer();
26 $relationship_key = $request->getURIData('relationshipKey');
28 $list = PhabricatorObjectRelationshipList::newForObject(
29 $viewer,
30 $object);
32 return $list->getRelationship($relationship_key);