Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F119860413
PasteInfoConduitAPIMethod.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
Sun, Jun 29, 22:33
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Jul 1, 22:33 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
27077555
Attached To
rPH Phabricator
PasteInfoConduitAPIMethod.php
View Options
<?php
final
class
PasteInfoConduitAPIMethod
extends
PasteConduitAPIMethod
{
public
function
getAPIMethodName
()
{
return
'paste.info'
;
}
public
function
getMethodStatus
()
{
return
self
::
METHOD_STATUS_DEPRECATED
;
}
public
function
getMethodStatusDescription
()
{
return
pht
(
"Replaced by '%s'."
,
'paste.query'
);
}
public
function
getMethodDescription
()
{
return
pht
(
'Retrieve an array of information about a paste.'
);
}
protected
function
defineParamTypes
()
{
return
array
(
'paste_id'
=>
'required id'
,
);
}
protected
function
defineReturnType
()
{
return
'nonempty dict'
;
}
protected
function
defineErrorTypes
()
{
return
array
(
'ERR_BAD_PASTE'
=>
pht
(
'No such paste exists.'
),
);
}
protected
function
execute
(
ConduitAPIRequest
$request
)
{
$paste_id
=
$request
->
getValue
(
'paste_id'
);
$paste
=
id
(
new
PhabricatorPasteQuery
())
->
setViewer
(
$request
->
getUser
())
->
withIDs
(
array
(
$paste_id
))
->
needRawContent
(
true
)
->
executeOne
();
if
(!
$paste
)
{
throw
new
ConduitException
(
'ERR_BAD_PASTE'
);
}
return
$this
->
buildPasteInfoDictionary
(
$paste
);
}
}
Event Timeline
Log In to Comment