Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97570838
ConduitAPI_paste_info_Method.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, Jan 5, 09:12
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Jan 7, 09:12 (2 d)
Engine
blob
Format
Raw Data
Handle
23428876
Attached To
rPH Phabricator
ConduitAPI_paste_info_Method.php
View Options
<?php
/**
* @group conduit
*/
final
class
ConduitAPI_paste_info_Method
extends
ConduitAPI_paste_Method
{
public
function
getMethodStatus
()
{
return
self
::
METHOD_STATUS_DEPRECATED
;
}
public
function
getMethodStatusDescription
()
{
return
"Replaced by 'paste.query'."
;
}
public
function
getMethodDescription
()
{
return
'Retrieve an array of information about a paste.'
;
}
public
function
defineParamTypes
()
{
return
array
(
'paste_id'
=>
'required id'
,
);
}
public
function
defineReturnType
()
{
return
'nonempty dict'
;
}
public
function
defineErrorTypes
()
{
return
array
(
'ERR_BAD_PASTE'
=>
'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