Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101609981
ConduitAPI_phriction_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
Wed, Feb 12, 01:27
Size
992 B
Mime Type
text/x-php
Expires
Fri, Feb 14, 01:27 (2 d)
Engine
blob
Format
Raw Data
Handle
24199996
Attached To
rPH Phabricator
ConduitAPI_phriction_info_Method.php
View Options
<?php
/**
* @group conduit
*/
final
class
ConduitAPI_phriction_info_Method
extends
ConduitAPI_phriction_Method
{
public
function
getMethodDescription
()
{
return
"Retrieve information about a Phriction document."
;
}
public
function
defineParamTypes
()
{
return
array
(
'slug'
=>
'required string'
,
);
}
public
function
defineReturnType
()
{
return
'nonempty dict'
;
}
public
function
defineErrorTypes
()
{
return
array
(
'ERR-BAD-DOCUMENT'
=>
'No such document exists.'
,
);
}
protected
function
execute
(
ConduitAPIRequest
$request
)
{
$slug
=
$request
->
getValue
(
'slug'
);
$doc
=
id
(
new
PhrictionDocument
())->
loadOneWhere
(
'slug = %s'
,
PhabricatorSlug
::
normalize
(
$slug
));
if
(!
$doc
)
{
throw
new
ConduitException
(
'ERR-BAD-DOCUMENT'
);
}
$content
=
id
(
new
PhrictionContent
())->
load
(
$doc
->
getContentID
());
$doc
->
attachContent
(
$content
);
return
$this
->
buildDocumentInfoDictionary
(
$doc
);
}
}
Event Timeline
Log In to Comment