Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F467523
FlagQueryConduitAPIMethod.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
FlagQueryConduitAPIMethod.php
View Options
<?php
final
class
FlagQueryConduitAPIMethod
extends
FlagConduitAPIMethod
{
public
function
getAPIMethodName
()
{
return
'flag.query'
;
}
public
function
getMethodDescription
()
{
return
pht
(
'Query flag markers.'
);
}
protected
function
defineParamTypes
()
{
return
array
(
'ownerPHIDs'
=>
'optional list<phid>'
,
'types'
=>
'optional list<type>'
,
'objectPHIDs'
=>
'optional list<phid>'
,
'offset'
=>
'optional int'
,
'limit'
=>
'optional int (default = 100)'
,
);
}
protected
function
defineReturnType
()
{
return
'list<dict>'
;
}
protected
function
execute
(
ConduitAPIRequest
$request
)
{
$query
=
new
PhabricatorFlagQuery
();
$query
->
setViewer
(
$request
->
getUser
());
$owner_phids
=
$request
->
getValue
(
'ownerPHIDs'
,
array
());
if
(
$owner_phids
)
{
$query
->
withOwnerPHIDs
(
$owner_phids
);
}
$object_phids
=
$request
->
getValue
(
'objectPHIDs'
,
array
());
if
(
$object_phids
)
{
$query
->
withObjectPHIDs
(
$object_phids
);
}
$types
=
$request
->
getValue
(
'types'
,
array
());
if
(
$types
)
{
$query
->
withTypes
(
$types
);
}
$query
->
needHandles
(
true
);
$query
->
setOffset
(
$request
->
getValue
(
'offset'
,
0
));
$query
->
setLimit
(
$request
->
getValue
(
'limit'
,
100
));
$flags
=
$query
->
execute
();
$results
=
array
();
foreach
(
$flags
as
$flag
)
{
$results
[]
=
$this
->
buildFlagInfoDictionary
(
$flag
);
}
return
$results
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, May 6, 3:16 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
80133
Default Alt Text
FlagQueryConduitAPIMethod.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment