Bitrix-D7  20.5.0
eventspool.php
См. документацию.
1 <?php
2 namespace Bitrix\Sale;
3 
4 class EventsPool
5 {
6  protected static $events = array();
7 
8 
9  public static function getEvents(Order $order)
10  {
11  if (isset(static::$events[$order->getInternalId()]))
12  {
13  return static::$events[$order->getInternalId()];
14  }
15 
16  return null;
17  }
18 
19  /**
20  * @param Order $order
21  * @param $type
22  * @param $event
23  */
24  public static function addEvent(Order $order, $type, $event)
25  {
26  static::$events[$order->getInternalId()][$type] = $event;
27  }
28 
29  /**
30  * @param Order $order
31  */
32  public static function resetEvents(Order $order = null)
33  {
34  if ($order !== null)
35  {
36  unset(static::$events[$order->getInternalId()]);
37  }
38  else
39  {
40  static::$events = array();
41  }
42  }
43 }
static resetEvents(Order $order=null)
Definition: eventspool.php:32
static addEvent(Order $order, $type, $event)
Definition: eventspool.php:24
static getEvents(Order $order)
Definition: eventspool.php:9