Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
eventspool.php
1<?php
3
4class EventsPool extends PoolBase
5{
6 protected static $events = array();
7
8 public static function getEvents($code)
9 {
10 $resultList = array();
11 $list = parent::getPoolByCode($code);
12
13 if (is_array($list) && !empty($list))
14 {
15 foreach ($list as $eventName => $eventData)
16 {
17 $resultList[$eventName] = reset($eventData);
18 }
19
20 $list = $resultList;
21 }
22
23 return $list;
24 }
25
26 public static function getEventsByType($code, $type)
27 {
28 $data = parent::get($code, $type);
29 if (!empty($data))
30 {
31 $data = reset($data);
32 }
33
34 return $data;
35 }
36
42 public static function addEvent($code, $type, $event)
43 {
44 parent::add($code, $type, $event);
45 }
46
53 public static function isEventTypeExists($code, $type)
54 {
55 return parent::isTypeExists($code, $type);
56 }
57
62 public static function resetEvents($code = null, $type = null)
63 {
64 parent::resetPool($code, $type);
65 }
66}
static isEventTypeExists($code, $type)
static addEvent($code, $type, $event)
static resetEvents($code=null, $type=null)
static getEventsByType($code, $type)