Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F73223307
DoorkeeperTagView.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, Jul 19, 18:27
Size
902 B
Mime Type
text/x-php
Expires
Sun, Jul 21, 18:27 (2 d)
Engine
blob
Format
Raw Data
Handle
19163835
Attached To
rPH Phabricator
DoorkeeperTagView.php
View Options
<?php
final
class
DoorkeeperTagView
extends
AphrontView
{
private
$xobj
;
public
function
setExternalObject
(
DoorkeeperExternalObject
$xobj
)
{
$this
->
xobj
=
$xobj
;
return
$this
;
}
public
function
render
()
{
$xobj
=
$this
->
xobj
;
if
(!
$xobj
)
{
throw
new
PhutilInvalidStateException
(
'setExternalObject'
);
}
$tag_id
=
celerity_generate_unique_node_id
();
$href
=
$xobj
->
getObjectURI
();
$spec
=
array
(
'id'
=>
$tag_id
,
'ref'
=>
array
(
$xobj
->
getApplicationType
(),
$xobj
->
getApplicationDomain
(),
$xobj
->
getObjectType
(),
$xobj
->
getObjectID
(),
),
);
Javelin
::
initBehavior
(
'doorkeeper-tag'
,
array
(
'tags'
=>
array
(
$spec
)));
return
id
(
new
PHUITagView
())
->
setID
(
$tag_id
)
->
setHref
(
$href
)
->
setName
(
$href
)
->
setType
(
PHUITagView
::
TYPE_OBJECT
)
->
setExternal
(
true
);
}
}
Event Timeline
Log In to Comment