1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
buffer.php
См. документацию.
1<?php
2
4
7
8class 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}
Определения error.php:15
addEvent(array $event)
Определения buffer.php:23
getEvents()
Определения buffer.php:39
static getInstance()
Определения buffer.php:13
</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
Определения buffer.php:3
$event
Определения prolog_after.php:141