Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101049565
ChatLogQueryConduitAPIMethod.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
Wed, Feb 5, 05:17
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Feb 7, 05:17 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
24084104
Attached To
rPH Phabricator
ChatLogQueryConduitAPIMethod.php
View Options
<?php
final
class
ChatLogQueryConduitAPIMethod
extends
ChatLogConduitAPIMethod
{
public
function
getAPIMethodName
()
{
return
'chatlog.query'
;
}
public
function
getMethodStatus
()
{
return
self
::
METHOD_STATUS_UNSTABLE
;
}
public
function
getMethodDescription
()
{
return
'Retrieve chatter.'
;
}
public
function
defineParamTypes
()
{
return
array
(
'channels'
=>
'optional list<string>'
,
'limit'
=>
'optional int (default = 100)'
,
);
}
public
function
defineReturnType
()
{
return
'nonempty list<dict>'
;
}
public
function
defineErrorTypes
()
{
return
array
();
}
protected
function
execute
(
ConduitAPIRequest
$request
)
{
$query
=
new
PhabricatorChatLogQuery
();
$channel_ids
=
$request
->
getValue
(
'channelIDs'
);
if
(
$channel_ids
)
{
$query
->
withChannelIDs
(
$channel_ids
);
}
$limit
=
$request
->
getValue
(
'limit'
);
if
(!
$limit
)
{
$limit
=
100
;
}
$query
->
setLimit
(
$limit
);
$logs
=
$query
->
execute
();
$results
=
array
();
foreach
(
$logs
as
$log
)
{
$results
[]
=
array
(
'channelID'
=>
$log
->
getChannelID
(),
'epoch'
=>
$log
->
getEpoch
(),
'author'
=>
$log
->
getAuthor
(),
'type'
=>
$log
->
getType
(),
'message'
=>
$log
->
getMessage
(),
'loggedByPHID'
=>
$log
->
getLoggedByPHID
(),
);
}
return
$results
;
}
}
Event Timeline
Log In to Comment