CRM-16575 fix - Searching/reporting on similar values in multi select fields breaks
[civicrm-core.git] / CRM / Core / Transaction.php
index 075859e855dad7ba68c0e8a4f1dbe9e5e6be1178..6cc7260f55ce6ae98e0aceeeca1f95c359c5148a 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
  * @copyright David Strauss <david@fourkitchens.com> (c) 2007
  * $Id$
  *
@@ -85,7 +85,7 @@
 class CRM_Core_Transaction {
 
   /**
-   * These constants represent phases at which callbacks can be invoked
+   * These constants represent phases at which callbacks can be invoked.
    */
   const PHASE_PRE_COMMIT = 1;
   const PHASE_POST_COMMIT = 2;
@@ -99,7 +99,7 @@ class CRM_Core_Transaction {
   private $_pseudoCommitted = FALSE;
 
   /**
-   * Ensure that an SQL transaction is started
+   * Ensure that an SQL transaction is started.
    *
    * This is a thin wrapper around __construct() which allows more fluent coding.
    *
@@ -114,7 +114,7 @@ class CRM_Core_Transaction {
   }
 
   /**
-   * Ensure that an SQL transaction is started
+   * Ensure that an SQL transaction is started.
    *
    * @param bool $nest
    *   Determines what to do if there's currently an active transaction:.
@@ -130,7 +130,7 @@ class CRM_Core_Transaction {
   }
 
   /**
-   * Immediately commit or rollback
+   * Immediately commit or rollback.
    *
    * (Note: Prior to 4.6, return void)
    *
@@ -183,7 +183,8 @@ class CRM_Core_Transaction {
   public function run($callable) {
     try {
       $callable($this);
-    } catch (Exception $ex) {
+    }
+    catch (Exception $ex) {
       $this->rollback()->commit();
       throw $ex;
     }
@@ -217,7 +218,7 @@ class CRM_Core_Transaction {
   }
 
   /**
-   * Determine whether there is a pending transaction
+   * Determine whether there is a pending transaction.
    */
   static public function isActive() {
     $frame = \Civi\Core\Transaction\Manager::singleton()->getFrame();
@@ -225,7 +226,7 @@ class CRM_Core_Transaction {
   }
 
   /**
-   * Add a transaction callback
+   * Add a transaction callback.
    *
    * Note: It's conceivable to add callbacks to the main/overall transaction
    * (aka $manager->getBaseFrame()) or to the innermost nested transaction
@@ -245,8 +246,9 @@ class CRM_Core_Transaction {
    *          See php manual call_user_func_array for details.
    * @param int $id
    */
-  static public function addCallback($phase, $callback, $params = null, $id = NULL) {
+  static public function addCallback($phase, $callback, $params = NULL, $id = NULL) {
     $frame = \Civi\Core\Transaction\Manager::singleton()->getBaseFrame();
     $frame->addCallback($phase, $callback, $params, $id);
   }
+
 }