<?php
/**
- * Test Generated example of using contact create API.
+ * Test Generated example demonstrating the Contact.create API.
*
* Demonstrates creating two websites as an array.
*
);
try{
- $result = civicrm_api3('contact', 'create', $params);
+ $result = civicrm_api3('Contact', 'create', $params);
}
catch (CiviCRM_API3_Exception $e) {
// Handle error here.
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'is_error' => 0,
'version' => 3,
'count' => 1,
- 'id' => 1,
+ 'id' => 3,
'values' => array(
- '1' => array(
- 'id' => '1',
+ '3' => array(
+ 'id' => '3',
'contact_type' => 'Individual',
'contact_sub_type' => '',
'do_not_email' => 0,
'values' => array(
'0' => array(
'id' => '1',
- 'contact_id' => '1',
+ 'contact_id' => '3',
'financial_type_id' => '1',
'contribution_page_id' => '',
'payment_instrument_id' => '1',
'campaign_id' => '',
'creditnote_id' => '',
'tax_amount' => '',
+ 'revenue_recognition_date' => '',
'contribution_type_id' => '1',
),
),
'values' => array(
'0' => array(
'id' => '1',
- 'contact_id' => '1',
+ 'contact_id' => '3',
'url' => 'http://civicrm.org',
'website_type_id' => '',
),
'values' => array(
'0' => array(
'id' => '2',
- 'contact_id' => '1',
+ 'contact_id' => '3',
'url' => 'http://chained.org',
'website_type_id' => '2',
),
return $expectedResult;
}
-/**
+/*
* This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateIndividualWithContributionChainedArrays
-* and can be found in
+* The test that created it is called "testCreateIndividualWithContributionChainedArrays"
+* 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