1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
factory.php
См. документацию.
1<?php
2namespace Bitrix\Main\Filter;
3
4use Bitrix\Main;
5
6class Factory
7{
8 protected static $methods = null;
9
15 protected static function prepareMethods()
16 {
17 if(self::$methods === null)
18 {
19 self::$methods = [];
20
21 $event = new Main\Event('main', 'OnBuildFilterFactoryMethods', []);
22 $event->send();
23
24 foreach($event->getResults() as $eventResult)
25 {
26 if($eventResult->getType() != Main\EventResult::SUCCESS)
27 {
28 continue;
29 }
30
31 $resultParams = $eventResult->getParameters();
32 if(isset($resultParams['callbacks']) && is_array($resultParams['callbacks']))
33 {
34 foreach($resultParams['callbacks'] as $entityTypeName => $callback)
35 {
36 if(is_callable($callback))
37 {
38 self::$methods[$entityTypeName] = $callback;
39 }
40 }
41 }
42 }
43 }
44 return self::$methods;
45 }
46
54 public static function createEntityFilter($entityTypeName, array $settingsParams, array $additionalParams = null)
55 {
57 if(isset($methods[$entityTypeName]))
58 {
59 $result = call_user_func_array($methods[$entityTypeName], [ $entityTypeName, $settingsParams, $additionalParams ]);
60 if($result instanceof Filter)
61 {
62 return $result;
63 }
64 }
65
67 "Entity type: '{$entityTypeName}' is not supported in current context."
68 );
69 }
70}
Определения event.php:5
static $methods
Определения factory.php:8
static prepareMethods()
Определения factory.php:15
static createEntityFilter($entityTypeName, array $settingsParams, array $additionalParams=null)
Определения factory.php:54
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$result
Определения get_property_values.php:14
$event
Определения prolog_after.php:141