• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/update/templateconverter.php
  • Класс: BitrixTasksUpdateTemplateConverter
  • Вызов: TemplateConverter::readTags
private function readTags($template): array
{
	$templateId = (int) $template['ID'];
	$userId = (int) $template['CREATED_BY'];

	if (empty($template['TAGS']))
	{
		return [];
	}

	$tags = unserialize($template['TAGS'], ['allowed_classes' => false]);
	if (
		!$tags
		|| !is_array($tags)
	)
	{
		return [];
	}

	$res = [];
	foreach ($tags as $tag)
	{
		if (empty($tag))
		{
			continue;
		}

		$res[] = [
			'TEMPLATE_ID' => $templateId,
			'USER_ID' => $userId,
			'NAME' => $tag,
		];
	}

	return $res;
}