15 if (! $types =& static::$types)
17 $event = static::$event;
18 $checkModule = static::$checkModule;
20 foreach (EventManager::getInstance()->findEventHandlers(
'conversion', $event) as $handler)
22 $result = ExecuteModuleEventEx($handler);
24 if (! is_array($result))
25 throw new SystemException(
'Not array returned from: '.print_r($handler,
true));
27 foreach ($result as $name => $type)
29 if (! is_array($type))
30 throw new SystemException(
'Not array in: '.$event.
'()['.$name.
'] => '.print_r($handler,
true));
34 if (! $type[
'MODULE'])
35 throw new SystemException(
'No [MODULE] in: '.$event.
'()['.$name.
'] => '.print_r($handler,
true));
39 throw new SystemException(
'Duplicate in: '.$event.
'()['.$name.
'] => '.print_r($handler,
true));
41 $types[$name] = $type;
49 static public function getTypes(array $filter =
null)
51 if (! $types =& static::$types)
53 static::getTypesInternal();
58 static::$ready =
true;
60 uasort($types,
function ($a, $b)
65 return $a < $b ? -1 : ($a > $b ? 1 : 0);
68 if (static::$checkModule)
70 $modules = Config::getModules();
71 foreach ($types as & $type)
73 $module = $modules[$type[
'MODULE']];
74 $type[
'ACTIVE'] = $module && $module[
'ACTIVE'];
82 $count = count($filter);
84 return array_filter($types,
function (array $type) use ($count, $filter)
86 return $count == count(array_intersect_assoc($filter, $type));