3 abstract class AlmanacPropertyController
extends AlmanacController
{
5 private $propertyObject;
7 public function getPropertyObject() {
8 return $this->propertyObject
;
11 protected function loadPropertyObject() {
12 $viewer = $this->getViewer();
13 $request = $this->getRequest();
14 $object_phid = $request->getStr('objectPHID');
17 switch (phid_get_type($object_phid)) {
18 case AlmanacBindingPHIDType
::TYPECONST
:
19 $query = new AlmanacBindingQuery();
21 case AlmanacDevicePHIDType
::TYPECONST
:
22 $query = new AlmanacDeviceQuery();
24 case AlmanacServicePHIDType
::TYPECONST
:
25 $query = new AlmanacServiceQuery();
28 return new Aphront404Response();
33 ->withPHIDs(array($object_phid))
34 ->requireCapabilities(
36 PhabricatorPolicyCapability
::CAN_VIEW
,
37 PhabricatorPolicyCapability
::CAN_EDIT
,
39 ->needProperties(true)
43 return new Aphront404Response();
46 if (!($object instanceof AlmanacPropertyInterface
)) {
47 return new Aphront404Response();
50 $this->propertyObject
= $object;