Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96476216
AlmanacPropertyController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Dec 27, 02:59
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Dec 29, 02:59 (2 d)
Engine
blob
Format
Raw Data
Handle
23190184
Attached To
rPH Phabricator
AlmanacPropertyController.php
View Options
<?php
abstract
class
AlmanacPropertyController
extends
AlmanacController
{
private
$propertyObject
;
public
function
getPropertyObject
()
{
return
$this
->
propertyObject
;
}
protected
function
loadPropertyObject
()
{
$viewer
=
$this
->
getViewer
();
$request
=
$this
->
getRequest
();
$object_phid
=
$request
->
getStr
(
'objectPHID'
);
switch
(
phid_get_type
(
$object_phid
))
{
case
AlmanacBindingPHIDType
::
TYPECONST
:
$query
=
new
AlmanacBindingQuery
();
break
;
case
AlmanacDevicePHIDType
::
TYPECONST
:
$query
=
new
AlmanacDeviceQuery
();
break
;
case
AlmanacServicePHIDType
::
TYPECONST
:
$query
=
new
AlmanacServiceQuery
();
break
;
default
:
return
new
Aphront404Response
();
}
$object
=
$query
->
setViewer
(
$viewer
)
->
withPHIDs
(
array
(
$object_phid
))
->
requireCapabilities
(
array
(
PhabricatorPolicyCapability
::
CAN_VIEW
,
PhabricatorPolicyCapability
::
CAN_EDIT
,
))
->
needProperties
(
true
)
->
executeOne
();
if
(!
$object
)
{
return
new
Aphront404Response
();
}
if
(!(
$object
instanceof
AlmanacPropertyInterface
))
{
return
new
Aphront404Response
();
}
$this
->
propertyObject
=
$object
;
return
null
;
}
}
Event Timeline
Log In to Comment