• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/internals/counter.php
  • Класс: BitrixTasksInternalsCounter
  • Вызов: Counter::getMajorForeignExpired
private function getMajorForeignExpired(string $mode = CounterDictionary::META_PROP_SONET): int
{
	$value = 0;

	if (
		!self::isSonetEnable()
		|| !MainLoader::includeModule('socialnetwork')
	)
	{
		return $value;
	}

	$registryMode = $this->getGroupMode($mode);

	$userGroups = UserRegistry::getInstance($this->userId)->getUserGroups($registryMode);
	foreach ($userGroups as $groupId => $role)
	{
		if (!in_array($role, [UserToGroupTable::ROLE_OWNER, UserToGroupTable::ROLE_MODERATOR]))
		{
			continue;
		}

		$value += $this->get(CounterDictionary::COUNTER_GROUP_EXPIRED, $groupId);
	}

	return $value;
}