BlogPost::copyComments

  1. Bitrix24 API (v. 23.675.0)
  2. blog
  3. BlogPost
  4. copyComments
  • Модуль: blog
  • Путь к файлу: ~/bitrix/modules/blog/lib/copy/implement/blogpost.php
  • Класс: BitrixBlogCopyImplementBlogPost
  • Вызов: BlogPost::copyComments
private function copyComments($blogPostId, $copiedBlogPostId)
{
	$containerCollection = new ContainerCollection();

	$queryObject = CBlogComment::getList([], ["POST_ID" => $blogPostId], false, false, ["ID"]);
	while ($blogPostComment = $queryObject->fetch())
	{
		$container = new Container($blogPostComment["ID"]);
		$container->setParentId($copiedBlogPostId);
		$containerCollection[] = $container;
	}

	if (!$containerCollection->isEmpty())
	{
		return $this->blogCommentCopier->copy($containerCollection);
	}

	return new Result();
}

Добавить комментарий