Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F98238001
DoorkeeperExternalObject.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
Sat, Jan 11, 08:43
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Jan 13, 08:43 (2 d)
Engine
blob
Format
Raw Data
Handle
23538362
Attached To
rPH Phabricator
DoorkeeperExternalObject.php
View Options
<?php
final
class
DoorkeeperExternalObject
extends
DoorkeeperDAO
implements
PhabricatorPolicyInterface
{
protected
$objectKey
;
protected
$applicationType
;
protected
$applicationDomain
;
protected
$objectType
;
protected
$objectID
;
protected
$objectURI
;
protected
$importerPHID
;
protected
$properties
=
array
();
protected
$viewPolicy
;
public
function
getConfiguration
()
{
return
array
(
self
::
CONFIG_AUX_PHID
=>
true
,
self
::
CONFIG_SERIALIZATION
=>
array
(
'properties'
=>
self
::
SERIALIZATION_JSON
,
),
)
+
parent
::
getConfiguration
();
}
public
function
generatePHID
()
{
return
PhabricatorPHID
::
generateNewPHID
(
PhabricatorPHIDConstants
::
PHID_TYPE_XOBJ
);
}
public
function
getProperty
(
$key
,
$default
=
null
)
{
return
idx
(
$this
->
properties
,
$key
,
$default
);
}
public
function
setProperty
(
$key
,
$value
)
{
$this
->
properties
[
$key
]
=
$value
;
return
$this
;
}
public
function
getObjectKey
()
{
$key
=
parent
::
getObjectKey
();
if
(
$key
===
null
)
{
$key
=
PhabricatorHash
::
digestForIndex
(
implode
(
':'
,
array
(
$this
->
getApplicationType
(),
$this
->
getApplicationDomain
(),
$this
->
getObjectType
(),
$this
->
getObjectID
(),
)));
}
return
$key
;
}
public
function
save
()
{
if
(!
$this
->
objectKey
)
{
$this
->
objectKey
=
$this
->
getObjectKey
();
}
return
parent
::
save
();
}
/* -( PhabricatorPolicyInterface )----------------------------------------- */
public
function
getCapabilities
()
{
return
array
(
PhabricatorPolicyCapability
::
CAN_VIEW
,
);
}
public
function
getPolicy
(
$capability
)
{
return
$this
->
viewPolicy
;
}
public
function
hasAutomaticCapability
(
$capability
,
PhabricatorUser
$viewer
)
{
return
false
;
}
}
Event Timeline
Log In to Comment