• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/control/tag.php
  • Класс: BitrixTasksControlTag
  • Вызов: Tag::getIdByUser
public function getIdByUser(array $tag, $userId = 0): int
{
	$tagName = $this->prepareTag($tag['NAME']);
	if (empty($userId))
	{
		$userId = $this->userId;
	}
	$this->cacheUserTags($userId);

	$currentTags = self::$storage[self::USER_TAGS_CACHE];

	foreach ($currentTags as $currentTag)
	{
		if ($this->prepareTag($currentTag['NAME']) === $tagName)
		{
			return (int)$currentTag['ID'];
		}
	}

	return 0;
}