1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
factory.php
См. документацию.
1
<?php
2
namespace
Bitrix\Main\Filter;
3
4
use Bitrix\Main;
5
6
class
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
{
56
$methods
=
self::prepareMethods
();
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
66
throw
new
Main\NotSupportedException
(
67
"Entity type: '{$entityTypeName}' is not supported in current context."
68
);
69
}
70
}
Bitrix\Main\Event
Определения
event.php:5
Bitrix\Main\Filter\Factory
Определения
factory.php:7
Bitrix\Main\Filter\Factory\$methods
static $methods
Определения
factory.php:8
Bitrix\Main\Filter\Factory\prepareMethods
static prepareMethods()
Определения
factory.php:15
Bitrix\Main\Filter\Factory\createEntityFilter
static createEntityFilter($entityTypeName, array $settingsParams, array $additionalParams=null)
Определения
factory.php:54
Bitrix\Main\NotSupportedException
Определения
NotSupportedException.php:9
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$result
$result
Определения
get_property_values.php:14
Bitrix\Main\Filter
Bitrix\Main
$event
$event
Определения
prolog_after.php:141
bitrix
modules
main
lib
filter
factory.php
Создано системой
1.14.0