<?php
-
-/*
-
+/**
+ * Test Generated example of using custom_group delete API
+ * *
*/
function custom_group_delete_example(){
-$params = array(
+$params = array(
'id' => 1,
- 'version' => 3,
);
- $result = civicrm_api( 'custom_group','delete',$params );
+try{
+ $result = civicrm_api3('custom_group', 'delete', $params);
+}
+catch (CiviCRM_API3_Exception $e) {
+ // handle error here
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
+}
- return $result;
+return $result;
}
-/*
+/**
* Function returns array of result expected from previous function
*/
function custom_group_delete_expectedresult(){
- $expectedResult = array(
+ $expectedResult = array(
'is_error' => 0,
'version' => 3,
'count' => 1,
'values' => 1,
);
- return $expectedResult ;
+ return $expectedResult;
}