12 $connection = \Bitrix\Main\Application::getInstance()->getConnection();
13 $sqlDate = $connection->getSqlHelper()->addDaysToDateTime(-1);
15 $channels = $connection->query(
"
16 SELECT ID, USER_ID, CHANNEL_TYPE
18 WHERE DATE_CREATE > {$sqlDate} AND USER_ID <> 0 AND CHANNEL_PUBLIC_ID IS NULL
21 while ($channel = $channels->fetch())
24 $connection->query(
"UPDATE b_pull_channel SET CHANNEL_PUBLIC_ID = '".\CPullChannel::GetNewChannelId(
'public').
"' WHERE ID = ".$channel[
'ID']);
25 $CACHE_MANAGER->Clean(
"b_pchc_".$channel[
'ID'].
'_'.$channel[
'CHANNEL_TYPE'],
"b_pull_channel");
28 return $hasChannels ? __METHOD__.
'();' :
'';