Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F989874
AlmanacPropertyController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
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
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Wed, Jun 18, 8:41 PM (1 d, 18 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
234365
Default Alt Text
AlmanacPropertyController.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment