Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2889256
PasteQueryConduitAPIMethod.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
PasteQueryConduitAPIMethod.php
View Options
<?php
final
class
PasteQueryConduitAPIMethod
extends
PasteConduitAPIMethod
{
public
function
getAPIMethodName
(
)
{
return
'paste.query'
;
}
public
function
getMethodDescription
(
)
{
return
pht
(
'Query Pastes.'
)
;
}
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 "paste.search" instead.'
)
;
}
protected
function
defineParamTypes
(
)
{
return
array
(
'ids'
=>
'optional list<int>'
,
'phids'
=>
'optional list<phid>'
,
'authorPHIDs'
=>
'optional list<phid>'
,
'after'
=>
'optional int'
,
'limit'
=>
'optional int, default = 100'
,
)
;
}
protected
function
defineReturnType
(
)
{
return
'list<dict>'
;
}
protected
function
execute
(
ConduitAPIRequest
$request
)
{
$query
=
id
(
new
PhabricatorPasteQuery
(
)
)
->
setViewer
(
$request
->
getUser
(
)
)
->
needRawContent
(
true
)
;
if
(
$request
->
getValue
(
'ids'
)
)
{
$query
->
withIDs
(
$request
->
getValue
(
'ids'
)
)
;
}
if
(
$request
->
getValue
(
'phids'
)
)
{
$query
->
withPHIDs
(
$request
->
getValue
(
'phids'
)
)
;
}
if
(
$request
->
getValue
(
'authorPHIDs'
)
)
{
$query
->
withAuthorPHIDs
(
$request
->
getValue
(
'authorPHIDs'
)
)
;
}
if
(
$request
->
getValue
(
'after'
)
)
{
$query
->
setAfterID
(
$request
->
getValue
(
'after'
)
)
;
}
$limit
=
$request
->
getValue
(
'limit'
,
100
)
;
if
(
$limit
)
{
$query
->
setLimit
(
$limit
)
;
}
$pastes
=
$query
->
execute
(
)
;
$results
=
array
(
)
;
foreach
(
$pastes
as
$paste
)
{
$results
[
$paste
->
getPHID
(
)
]
=
$this
->
buildPasteInfoDictionary
(
$paste
)
;
}
return
$results
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Jan 19 2025, 11:53 (4 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1124282
Default Alt Text
PasteQueryConduitAPIMethod.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment