1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
webhook.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Rest\Preset\Data;
4
5
use Bitrix\Main\Data\Cache;
6
use Bitrix\Rest\Dictionary;
7
use CRestUtil;
8
13
class
Webhook
14
{
15
private
const
CACHE_TIME = 86400;
16
private
const
CACHE_DIR =
'/rest/integration/data/webhook/'
;
17
21
public
static
function
getList
() :
array
22
{
23
$result
= [];
24
25
$cache = Cache::createInstance();
26
if
($cache->initCache(static::CACHE_TIME,
'all'
. LANGUAGE_ID, static::CACHE_DIR))
27
{
28
$result
= $cache->getVars();
29
}
30
elseif
($cache->startDataCache())
31
{
32
$eventDictionary =
new
Dictionary\WebHook
();
33
$eventDictionaryResult = [];
34
foreach
($eventDictionary as
$event
)
35
{
36
$eventDictionaryResult[mb_strtoupper(
$event
[
'code'
])] =
$event
;
37
}
38
$eventList = CRestUtil::getEventList();
39
$eventDistinctId = [];
40
foreach
($eventList as
$type
=> $events)
41
{
42
foreach
($events as
$event
)
43
{
44
if
(array_key_exists(
$event
, $eventDictionaryResult) && !in_array(mb_strtoupper(
$event
), $eventDistinctId))
45
{
46
$event
= mb_strtoupper(
$event
);
47
$eventDistinctId[] =
$event
;
48
49
$result
[] = [
50
'id'
=>
$event
,
51
'name'
=> !empty($eventDictionaryResult[
$event
][
'name'
])
52
? $eventDictionaryResult[
$event
][
'name'
] .
' ('
.
$event
.
')'
:
$event
,
53
'descr'
=> !empty($eventDictionaryResult[
$event
][
'descr'
])
54
? $eventDictionaryResult[
$event
][
'descr'
] :
''
,
55
];
56
}
57
}
58
}
59
$cache->endDataCache(
$result
);
60
}
61
62
return
$result
;
63
}
64
}
$type
$type
Определения
options.php:106
Bitrix\Rest\Dictionary\WebHook
Определения
webhook.php:12
Bitrix\Rest\Preset\Data\Webhook
Определения
webhook.php:14
Bitrix\Rest\Preset\Data\Webhook\getList
static getList()
Определения
webhook.php:21
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
$event
$event
Определения
prolog_after.php:141
elseif
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения
prolog_main_admin.php:393
bitrix
modules
rest
lib
preset
data
webhook.php
Создано системой
1.14.0