Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F118852304
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
Sun, Jun 22, 14:09
Size
992 B
Mime Type
text/x-php
Expires
Tue, Jun 24, 14:09 (2 d)
Engine
blob
Format
Raw Data
Handle
26922287
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