Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F959850
TokenGiveConduitAPIMethod.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
958 B
Referenced Files
None
Subscribers
None
TokenGiveConduitAPIMethod.php
View Options
<?php
final
class
TokenGiveConduitAPIMethod
extends
TokenConduitAPIMethod
{
public
function
getAPIMethodName
()
{
return
'token.give'
;
}
public
function
getMethodDescription
()
{
return
pht
(
'Give or change a token.'
);
}
protected
function
defineParamTypes
()
{
return
array
(
'tokenPHID'
=>
'phid|null'
,
'objectPHID'
=>
'phid'
,
);
}
protected
function
defineReturnType
()
{
return
'void'
;
}
protected
function
execute
(
ConduitAPIRequest
$request
)
{
$content_source
=
PhabricatorContentSource
::
newFromConduitRequest
(
$request
);
$editor
=
id
(
new
PhabricatorTokenGivenEditor
())
->
setActor
(
$request
->
getUser
())
->
setContentSource
(
$content_source
);
if
(
$request
->
getValue
(
'tokenPHID'
))
{
$editor
->
addToken
(
$request
->
getValue
(
'objectPHID'
),
$request
->
getValue
(
'tokenPHID'
));
}
else
{
$editor
->
deleteToken
(
$request
->
getValue
(
'objectPHID'
));
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Jun 17, 10:30 PM (1 d, 15 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
228524
Default Alt Text
TokenGiveConduitAPIMethod.php (958 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment