projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #10155 from totten/master-pdf-save2
[civicrm-core.git]
/
api
/
v3
/
examples
/
Contact
/
APIChainedArrayValuesFromSiblingFunction.php
diff --git
a/api/v3/examples/Contact/APIChainedArrayValuesFromSiblingFunction.php
b/api/v3/examples/Contact/APIChainedArrayValuesFromSiblingFunction.php
index d5340153d56e8cb2fe8d2d2d7c733c38322472d6..6bca265586b6a07580e2d29c5694e23008c542fc 100644
(file)
--- a/
api/v3/examples/Contact/APIChainedArrayValuesFromSiblingFunction.php
+++ b/
api/v3/examples/Contact/APIChainedArrayValuesFromSiblingFunction.php
@@
-1,15
+1,9
@@
<?php
/**
<?php
/**
- * @file
- * Test Generated API Example.
- * See bottom of this file for more detail.
- */
-
-/**
- * Test Generated example of using contact create API.
+ * Test Generated example demonstrating the Contact.create API.
*
*
- *
/*t
his demonstrates the usage of chained api functions. Specifically it has one 'parent function' &
- 2 child functions - one receives values from the parent (Contact) and the other child (Tag).
+ *
T
his demonstrates the usage of chained api functions. Specifically it has one 'parent function' &
+ * 2 child functions - one receives values from the parent (Contact) and the other child (Tag).
*
* @return array
* API result array
*
* @return array
* API result array
@@
-29,7
+23,7
@@
function contact_create_example() {
);
try{
);
try{
- $result = civicrm_api3('
c
ontact', 'create', $params);
+ $result = civicrm_api3('
C
ontact', 'create', $params);
}
catch (CiviCRM_API3_Exception $e) {
// Handle error here.
}
catch (CiviCRM_API3_Exception $e) {
// Handle error here.
@@
-37,7
+31,8
@@
function contact_create_example() {
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'error_code' => $errorCode,
'error_data' => $errorData,
);
@@
-58,10
+53,10
@@
function contact_create_expectedresult() {
'is_error' => 0,
'version' => 3,
'count' => 1,
'is_error' => 0,
'version' => 3,
'count' => 1,
- 'id' =>
1
,
+ 'id' =>
3
,
'values' => array(
'values' => array(
- '
1
' => array(
- 'id' => '
1
',
+ '
3
' => array(
+ 'id' => '
3
',
'contact_type' => 'Individual',
'contact_sub_type' => '',
'do_not_email' => 0,
'contact_type' => 'Individual',
'contact_sub_type' => '',
'do_not_email' => 0,
@@
-72,7
+67,7
@@
function contact_create_expectedresult() {
'is_opt_out' => 0,
'legal_identifier' => '',
'external_identifier' => '',
'is_opt_out' => 0,
'legal_identifier' => '',
'external_identifier' => '',
- 'sort_name' => '',
+ 'sort_name' => '
batman
',
'display_name' => 'batman',
'nick_name' => '',
'legal_name' => '',
'display_name' => 'batman',
'nick_name' => '',
'legal_name' => '',
@@
-124,11
+119,10
@@
function contact_create_expectedresult() {
return $expectedResult;
}
return $expectedResult;
}
-/*
*
+/*
* This example has been generated from the API test suite.
* This example has been generated from the API test suite.
-* The test that created it is called
-* testChainingValuesCreate
-* and can be found in
+* The test that created it is called "testChainingValuesCreate"
+* 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
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
*
* You can see the outcome of the API tests at
@@
-138,7
+132,7
@@
function contact_create_expectedresult() {
* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
*
* Browse the api on your own site with the api explorer
* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
*
* Browse the api on your own site with the api explorer
-* http://MYSITE.ORG/path/to/civicrm/api
/explorer
+* http://MYSITE.ORG/path/to/civicrm/api
*
* Read more about testing here
* http://wiki.civicrm.org/confluence/display/CRM/Testing
*
* Read more about testing here
* http://wiki.civicrm.org/confluence/display/CRM/Testing