1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
buffer.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Rest\Event
;
4
5
use
Bitrix\Main\Error
;
6
use
Bitrix\Main\Result
;
7
8
class
Buffer
9
{
10
private
static
Buffer
$instance;
11
private
array
$events = [];
12
13
public
static
function
getInstance
(): self
14
{
15
if
(!isset(self::$instance))
16
{
17
self::$instance =
new
self
;
18
}
19
20
return
self::$instance;
21
}
22
23
public
function
addEvent
(
array
$event
):
Result
24
{
25
$result
=
new
Result
();
26
27
if
(!$this->isEventDuplicate(
$event
))
28
{
29
$this->events[] =
$event
;
30
}
31
else
32
{
33
$result
->addError(
new
Error
(
'Event already added'
));
34
}
35
36
return
$result
;
37
}
38
39
public
function
getEvents
():
array
40
{
41
return
$this->events;
42
}
43
44
private
function
isEventDuplicate(
array
$event
): bool
45
{
46
return
in_array(
$event
, $this->events,
true
);
47
}
48
49
private
function
__construct()
50
{
51
}
52
53
private
function
__clone()
54
{
55
}
56
}
Bitrix\Main\Error
Определения
error.php:15
Bitrix\Main\ORM\Data\Result
Определения
result.php:16
Bitrix\Rest\Event\Buffer
Определения
buffer.php:9
Bitrix\Rest\Event\Buffer\addEvent
addEvent(array $event)
Определения
buffer.php:23
Bitrix\Rest\Event\Buffer\getEvents
getEvents()
Определения
buffer.php:39
Bitrix\Rest\Event\Buffer\getInstance
static getInstance()
Определения
buffer.php:13
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\Rest\Event
Определения
buffer.php:3
$event
$event
Определения
prolog_after.php:141
bitrix
modules
rest
lib
event
buffer.php
Создано системой
1.14.0