19 'upper' => FunctionUpper::class,
20 'lower' => FunctionLower::class,
21 'translit' => FunctionTranslit::class,
22 'concat' => FunctionConcat::class,
23 'limit' => FunctionLimit::class,
24 'contrast' => FunctionContrast::class,
25 'min' => FunctionMin::class,
26 'max' => FunctionMax::class,
27 'distinct' => FunctionDistinct::class,
28 'ucfirst' => FunctionUcfirst::class,
29 'ucwords' => FunctionUcwords::class,
41 public static function createInstance($functionName, $data =
null)
43 if (!is_string($functionName))
47 if (isset(self::$defaultFunctionMap[$functionName]))
50 $functionClass = self::$defaultFunctionMap[$functionName];
51 return new $functionClass($data);
53 elseif (isset(self::$functionMap[$functionName]))
56 $functionClass = self::$functionMap[$functionName];
57 return new $functionClass($data);
61 $event = new \Bitrix\Main\Event(
"iblock",
"OnTemplateGetFunctionClass", array($functionName));
63 if ($event->getResults())
65 foreach($event->getResults() as $evenResult)
67 if($evenResult->getType() == \
Bitrix\Main\EventResult::SUCCESS)
69 $functionClass = $evenResult->getParameters();
70 if (is_string($functionClass) && class_exists($functionClass))
72 self::$functionMap[$functionName] = $functionClass;
78 if (isset(self::$functionMap[$functionName]))
80 $functionClass = self::$functionMap[$functionName];
81 return new $functionClass($data);