Remove unnecessary try/catch per #17729
[civicrm-core.git] / CRM / Utils / Hook.php
index 32f01c2f3ff3dca8cd8bb4b12909a3fe0174678e..38c1da128e0db51fdf0e1678591e21dea5858ec7 100644 (file)
@@ -531,6 +531,26 @@ abstract class CRM_Utils_Hook {
       ->invoke(['op', 'groupID', 'entityID', 'params'], $op, $groupID, $entityID, $params, self::$_nullObject, self::$_nullObject, 'civicrm_custom');
   }
 
+  /**
+   * This hook is called before a db write on a custom table.
+   *
+   * @param string $op
+   *   The type of operation being performed.
+   * @param string $groupID
+   *   The custom group ID.
+   * @param object $entityID
+   *   The entityID of the row in the custom table.
+   * @param array $params
+   *   The parameters that were sent into the calling function.
+   *
+   * @return null
+   *   the return value is ignored
+   */
+  public static function customPre($op, $groupID, $entityID, &$params) {
+    return self::singleton()
+      ->invoke(['op', 'groupID', 'entityID', 'params'], $op, $groupID, $entityID, $params, self::$_nullObject, self::$_nullObject, 'civicrm_customPre');
+  }
+
   /**
    * This hook is called when composing the ACL where clause to restrict
    * visibility of contacts to the logged in user