Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F1369483
PhrictionHistoryConduitAPIMethod.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
PhrictionHistoryConduitAPIMethod.php
View Options
<?php
final
class
PhrictionHistoryConduitAPIMethod
extends
PhrictionConduitAPIMethod
{
public
function
getAPIMethodName
()
{
return
'phriction.history'
;
}
public
function
getMethodDescription
()
{
return
pht
(
'Retrieve history about a Phriction document.'
);
}
public
function
getMethodStatus
()
{
return
self
::
METHOD_STATUS_FROZEN
;
}
public
function
getMethodStatusDescription
()
{
return
pht
(
'This method is frozen and will eventually be deprecated. New code '
.
'should use "phriction.content.search" instead.'
);
}
protected
function
defineParamTypes
()
{
return
array
(
'slug'
=>
'required string'
,
);
}
protected
function
defineReturnType
()
{
return
'nonempty list'
;
}
protected
function
defineErrorTypes
()
{
return
array
(
'ERR-BAD-DOCUMENT'
=>
pht
(
'No such document exists.'
),
);
}
protected
function
execute
(
ConduitAPIRequest
$request
)
{
$slug
=
$request
->
getValue
(
'slug'
);
$doc
=
id
(
new
PhrictionDocumentQuery
())
->
setViewer
(
$request
->
getUser
())
->
withSlugs
(
array
(
PhabricatorSlug
::
normalize
(
$slug
)))
->
executeOne
();
if
(!
$doc
)
{
throw
new
ConduitException
(
'ERR-BAD-DOCUMENT'
);
}
$content
=
id
(
new
PhrictionContent
())->
loadAllWhere
(
'documentID = %d ORDER BY version DESC'
,
$doc
->
getID
());
$results
=
array
();
foreach
(
$content
as
$version
)
{
$results
[]
=
$this
->
buildDocumentContentDictionary
(
$doc
,
$version
);
}
return
$results
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Jul 7, 3:17 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
268605
Default Alt Text
PhrictionHistoryConduitAPIMethod.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment