Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101496086
ConduitAPI_phame_query_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
Tue, Feb 11, 00:37
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Feb 13, 00:37 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
24166052
Attached To
rPH Phabricator
ConduitAPI_phame_query_Method.php
View Options
<?php
/**
* @group conduit
*/
final
class
ConduitAPI_phame_query_Method
extends
ConduitAPI_phame_Method
{
public
function
getMethodDescription
()
{
return
"Query phame blogs."
;
}
public
function
getMethodStatus
()
{
return
self
::
METHOD_STATUS_UNSTABLE
;
}
public
function
defineParamTypes
()
{
return
array
(
'ids'
=>
'optional list<int>'
,
'phids'
=>
'optional list<phid>'
,
'after'
=>
'optional int'
,
'before'
=>
'optional int'
,
'limit'
=>
'optional int'
,
);
}
public
function
defineReturnType
()
{
return
'list<dict>'
;
}
public
function
defineErrorTypes
()
{
return
array
(
);
}
protected
function
execute
(
ConduitAPIRequest
$request
)
{
$query
=
new
PhameBlogQuery
();
$query
->
setViewer
(
$request
->
getUser
());
$ids
=
$request
->
getValue
(
'ids'
,
array
());
if
(
$ids
)
{
$query
->
withIDs
(
$ids
);
}
$phids
=
$request
->
getValue
(
'phids'
,
array
());
if
(
$phids
)
{
$query
->
withPHIDs
(
$phids
);
}
$after
=
$request
->
getValue
(
'after'
,
null
);
if
(
$after
!==
null
)
{
$query
->
setAfterID
(
$after
);
}
$before
=
$request
->
getValue
(
'before'
,
null
);
if
(
$before
!==
null
)
{
$query
->
setBeforeID
(
$before
);
}
$limit
=
$request
->
getValue
(
'limit'
,
null
);
if
(
$limit
!==
null
)
{
$query
->
setLimit
(
$limit
);
}
$blogs
=
$query
->
execute
();
$results
=
array
();
foreach
(
$blogs
as
$blog
)
{
$results
[]
=
array
(
'id'
=>
$blog
->
getID
(),
'phid'
=>
$blog
->
getPHID
(),
'name'
=>
$blog
->
getName
(),
'description'
=>
$blog
->
getDescription
(),
'domain'
=>
$blog
->
getDomain
(),
'creatorPHID'
=>
$blog
->
getCreatorPHID
(),
);
}
return
$results
;
}
}
Event Timeline
Log In to Comment