Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CallbackPool.php
Go to the documentation of this file.
1 <?php
8 
13 {
19  private static $commitCallbacks = [];
20 
26  public static function attach($hashKey, $callback)
27  {
28  self::$commitCallbacks[$hashKey][] = $callback;
29  }
30 
35  public static function clear($hashKey)
36  {
37  self::$commitCallbacks[$hashKey] = [];
38  }
39 
44  public static function get($hashKey)
45  {
46  if (!isset(self::$commitCallbacks[$hashKey])) {
47  return [];
48  }
49  $callbacks = self::$commitCallbacks[$hashKey];
50  self::$commitCallbacks[$hashKey] = [];
51  return $callbacks;
52  }
53 }
static attach($hashKey, $callback)