mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 16:52:41 +01:00
Populating Channel Id's
Summary: Modified the conduitAPI_chatlog_record method to populate channel Id's Test Plan: Check if the new chatlog channel table is getting populated with entries Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4979
This commit is contained in:
parent
638d1b4447
commit
6c1043cf58
1 changed files with 21 additions and 2 deletions
|
@ -40,9 +40,28 @@ final class ConduitAPI_chatlog_record_Method
|
|||
|
||||
$objs = array();
|
||||
foreach ($logs as $log) {
|
||||
$channel_name = idx($log, 'channel');
|
||||
$service_name = idx($log, 'serviceName');
|
||||
$service_type = idx($log, 'serviceType');
|
||||
|
||||
$channel = id(new PhabricatorChatLogChannel())
|
||||
->loadOneWhere(
|
||||
'channelName = %s AND serviceName = %s
|
||||
AND serviceType = %s', $channel_name,
|
||||
$service_name, $service_type
|
||||
);
|
||||
|
||||
if (!$channel) {
|
||||
$channel = id(new PhabricatorChatLogChannel())
|
||||
->setChannelName($channel_name)
|
||||
->setserviceName($service_name)
|
||||
->setServiceType($service_type)
|
||||
->save();
|
||||
}
|
||||
|
||||
$obj = clone $template;
|
||||
$obj->setChannel(idx($log, 'channel'));
|
||||
$obj->setChannelID(0);
|
||||
$obj->setChannel($channel_name);
|
||||
$obj->setChannelID($channel->getID());
|
||||
$obj->setType(idx($log, 'type'));
|
||||
$obj->setAuthor(idx($log, 'author'));
|
||||
$obj->setEpoch(idx($log, 'epoch'));
|
||||
|
|
Loading…
Reference in a new issue