• Модуль: conversion
  • Путь к файлу: ~/bitrix/modules/conversion/lib/internals/typemanager.php
  • Класс: BitrixConversionInternalsTypeManager
  • Вызов: TypeManager::getTypes
public function getTypes(array $filter = null)
{
	if (! $types =& static::$types)
	{
		static::getTypesInternal();
	}

	if (! static::$ready)
	{
		static::$ready = true;

		uasort($types, function ($a, $b)
		{
			$a = $a['SORT'];
			$b = $b['SORT'];

			return $a < $b ? -1 : ($a > $b ? 1 : 0);
		});

		if (static::$checkModule)
		{
			$modules = Config::getModules();
			foreach ($types as & $type)
			{
				$module = $modules[$type['MODULE']];
				$type['ACTIVE'] = $module && $module['ACTIVE'];
			}
			unset($type);
		}
	}

	if ($filter)
	{
		$count = count($filter);

		return array_filter($types, function (array $type) use ($count, $filter)
		{
			return $count == count(array_intersect_assoc($filter, $type));
		});
	}
	else
	{
		return $types;
	}
}