Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96121435
PhrictionInfoConduitAPIMethod.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, Dec 22, 21:03
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Dec 24, 21:03 (2 d)
Engine
blob
Format
Raw Data
Handle
23126745
Attached To
rPH Phabricator
PhrictionInfoConduitAPIMethod.php
View Options
<?php
final
class
PhrictionInfoConduitAPIMethod
extends
PhrictionConduitAPIMethod
{
public
function
getAPIMethodName
()
{
return
'phriction.info'
;
}
public
function
getMethodDescription
()
{
return
pht
(
'Retrieve information about a Phriction document.'
);
}
protected
function
defineParamTypes
()
{
return
array
(
'slug'
=>
'required string'
,
);
}
protected
function
defineReturnType
()
{
return
'nonempty dict'
;
}
protected
function
defineErrorTypes
()
{
return
array
(
'ERR-BAD-DOCUMENT'
=>
pht
(
'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
);
}
}
Event Timeline
Log In to Comment