• Модуль: socialnetwork
  • Путь к файлу: ~/bitrix/modules/socialnetwork/lib/internals/counter/push/workgrouprequestssender.php
  • Класс: BitrixSocialnetworkInternalsCounterPushWorkgroupRequestsSender
  • Вызов: WorkgroupRequestsSender::sendPersonalPush
protected function sendPersonalPush(array $pushList = []): void
{
	$workgroupIdList = [];

	foreach ($pushList as $push)
	{
		if (!in_array($push['EVENT'], [
			CounterEventEventDictionary::EVENT_WORKGROUP_USER_ADD,
			CounterEventEventDictionary::EVENT_WORKGROUP_USER_UPDATE,
			CounterEventEventDictionary::EVENT_WORKGROUP_USER_DELETE,
		], true)
		)
		{
			continue;
		}

		$workgroupIdList[] = $push['GROUP_ID'];
	}

	$workgroupIdList = array_unique($workgroupIdList);
	if (empty($workgroupIdList))
	{
		return;
	}

	$userIdList = $this->getRecipients($workgroupIdList);

	foreach ($workgroupIdList as $workgroupId)
	{
		if (empty($userIdList[$workgroupId]))
		{
			continue;
		}

		(new PushSender())->sendUserCounters($userIdList[$workgroupId], [
			'workgroupId' => $workgroupId,
			'values' => $this->getWorkgroupCounters($workgroupId),
		]);
	}
}