CRM-14897 - fix adminGroup for Cleanup Caches so it appears properly in admin console.
[civicrm-core.git] / CRM / Core / Transaction.php
index 63493f151eb579544577a7382439d1681b1aa47a..17f7e9a88d6efbf19b1c59617fded9141534d12d 100644 (file)
@@ -198,11 +198,18 @@ class CRM_Core_Transaction {
    * @param mixed $params Optional values to pass to callback.
    *          See php manual call_user_func_array for details.
    */
-  static public function addCallback($phase, $callback, $params = null) {
-    self::$_callbacks[$phase][] = array(
-      'callback' => $callback,
-      'parameters' => (is_array($params) ? $params : array($params))
-    );
+  static public function addCallback($phase, $callback, $params = null, $id = NULL) {
+    if ($id) {
+      self::$_callbacks[$phase][$id] = array(
+        'callback' => $callback,
+        'parameters' => (is_array($params) ? $params : array($params))
+      );
+    } else {
+      self::$_callbacks[$phase][] = array(
+        'callback' => $callback,
+        'parameters' => (is_array($params) ? $params : array($params))
+      );
+    }
   }
 
   /**