Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F113172051
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
Thu, May 15, 19:13
Size
992 B
Mime Type
text/x-php
Expires
Sat, May 17, 19:13 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
26189493
Attached To
rPH Phabricator
ConduitAPI_phriction_info_Method.php
View Options
<?php
final
class
ConduitAPI_phriction_info_Method
extends
ConduitAPI_phriction_Method
{
public
function
getMethodDescription
()
{
return
pht
(
'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'
);
$document
=
id
(
new
PhrictionDocumentQuery
())
->
setViewer
(
$request
->
getUser
())
->
withSlugs
(
array
(
PhabricatorSlug
::
normalize
(
$slug
)))
->
needContent
(
true
)
->
executeOne
();
if
(!
$document
)
{
throw
new
ConduitException
(
'ERR-BAD-DOCUMENT'
);
}
return
$this
->
buildDocumentInfoDictionary
(
$document
,
$document
->
getContent
());
}
}
Event Timeline
Log In to Comment