• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/ui/viewer/transformation/transformermanager.php
  • Класс: BitrixMainUIViewerTransformationTransformerManager
  • Вызов: TransformerManager::buildTransformationList
private function buildTransformationList()
{
	if (!empty(static::$transformationList))
	{
		return;
	}

	$default = [
		Document::class,
		Video::class,
	];

	$event = new Event('main', 'onTransformationBuildList');
	$event->send();

	$additionalList = [];
	foreach ($event->getResults() as $result)
	{
		if ($result->getType() != EventResult::SUCCESS)
		{
			continue;
		}
		$result = $result->getParameters();
		if (!is_array($result))
		{
			throw new SystemException('Wrong event result. Must be array.');
		}

		foreach ($result as $class)
		{
			if (!is_string($class) || !class_exists($class))
			{
				throw new SystemException('Wrong event result. There is not a class.');
			}

			if (!is_subclass_of($class, Transformation::class, true))
			{
				throw new SystemException("Wrong event result. {$class} is not a subclass of " . Transformation::class);
			}

			$additionalList[] = $class;
		}
	}

	static::$transformationList = array_merge($default, $additionalList);
}