Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F100184610
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
Tue, Jan 28, 20:54
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Jan 30, 20:54 (2 d)
Engine
blob
Format
Raw Data
Handle
23920050
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