Group::attachGroupToPost

  1. Bitrix24 API (v. 23.675.0)
  2. blog
  3. Group
  4. attachGroupToPost
  • Модуль: blog
  • Путь к файлу: ~/bitrix/modules/blog/lib/copy/integration/group.php
  • Класс: BitrixBlogCopyIntegrationGroup
  • Вызов: Group::attachGroupToPost
private function attachGroupToPost($groupIdToCopy, $copiedGroupId)
{
	$blogPosts = $this->getBlogPosts($groupIdToCopy);

	foreach ($blogPosts as $blogPost)
	{
		$sonetRights = $this->getSonetBlogPostRights($blogPost["ID"]);
		$sonetRights[] = "SG".$copiedGroupId;
		$newBlogPostRights = ["SG".$copiedGroupId];
		ComponentHelper::processBlogPostShare(
			[
				"POST_ID" => $blogPost["ID"],
				"BLOG_ID" => $blogPost["BLOG_ID"],
				"SITE_ID" => SITE_ID,
				"SONET_RIGHTS" => $sonetRights,
				"NEW_RIGHTS" => $newBlogPostRights,
				"USER_ID" => $this->executiveUserId
			],
			[]
		);
	}

	return new Result();
}

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