<?php
// CBlogPost :: DeleteLog()
// /dist/bitrix/modules/blog/general/blog_post.php:1022
public static function DeleteLog($postID, $bMicroblog = false)
{
static $blogPostEventIdList = null;
if (!CModule::IncludeModule('socialnetwork'))
{
return;
}
$dbComment = CBlogComment::GetList(
array(),
array(
"POST_ID" => $postID,
),
false,
false,
array("ID")
);
while ($arComment = $dbComment->Fetch())
{
$dbRes = CSocNetLog::GetList(
array("ID" => "DESC"),
array(
"EVENT_ID" => Array("blog_comment", "blog_comment_micro"),
"SOURCE_ID" => $arComment["ID"]
),
false,
false,
array("ID")
);
while ($arRes = $dbRes->Fetch())
CSocNetLog::Delete($arRes["ID"]);
}
if ($blogPostEventIdList === null)
{
$blogPostLivefeedProvider = new \Bitrix\Socialnetwork\Livefeed\BlogPost;
$blogPostEventIdList = $blogPostLivefeedProvider->getEventId();
}
$dbRes = CSocNetLog::GetList(
array("ID" => "DESC"),
array(
"EVENT_ID" => $blogPostEventIdList,
"SOURCE_ID" => $postID
),
false,
false,
array("ID")
);
while ($arRes = $dbRes->Fetch())
CSocNetLog::Delete($arRes["ID"]);
}