• Модуль: socialnetwork
  • Путь к файлу: ~/bitrix/modules/socialnetwork/lib/internals/counter/countercontroller.php
  • Класс: BitrixSocialnetworkInternalsCounterCounterController
  • Вызов: CounterController::getInstance
static function getInstance(string $name = '', int $entityId = 0, int $userId = 0): ProviderBase
{
	switch ($name)
	{
		case CounterDictionary::COUNTER_WORKGROUP_REQUESTS_IN:
			$result = new ProviderWorkgroupRequestsIn([
				'workgroupId' => $entityId,
			]);
			break;
		case CounterDictionary::COUNTER_WORKGROUP_REQUESTS_OUT:
			$result = new ProviderWorkgroupRequestsOut([
				'workgroupId' => $entityId,
			]);
			break;
		case CounterDictionary::COUNTER_WORKGROUP_LIST_LIVEFEED:
			$result = new ProviderWorkgroupListLivefeed([
				'userId' => $userId,
			]);
			break;
		case CounterDictionary::COUNTER_WORKGROUP_LIST_TASKS:
			$result = new ProviderWorkgroupListTasks([
				'userId' => $userId,
			]);
			break;
		default:
			throw new UnknownCounterException();
	}

	return $result;
}