Merge pull request #9783 from mattwire/back_to_single_lang
[civicrm-core.git] / api / v3 / examples / Contact / Delete.php
index 72597cdf1b7811b5506ca20252830b8377da4898..1bb7f83feb3e21c2eea3bbc3f45bc60e84626884 100644 (file)
@@ -1,18 +1,17 @@
 <?php
 /**
- * Test Generated example of using contact delete API.
- *
+ * Test Generated example demonstrating the Contact.delete API.
  *
  * @return array
  *   API result array
  */
 function contact_delete_example() {
   $params = array(
-    'id' => 1,
+    'id' => 3,
   );
 
   try{
-    $result = civicrm_api3('contact', 'delete', $params);
+    $result = civicrm_api3('Contact', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -20,7 +19,8 @@ function contact_delete_example() {
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
     return array(
-      'error' => $errorMessage,
+      'is_error' => 1,
+      'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
     );
@@ -47,11 +47,10 @@ function contact_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testContactDelete
-* and can be found in
+* The test that created it is called "testContactDelete"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
 *
 * You can see the outcome of the API tests at