<?php
/**
- * Test Generated example of using contact GetFields API.
+ * Test Generated example demonstrating the Contact.getfields API.
*
- * Demonstrate retrieving metadata with custom field options
+ * Demonstrates retrieving metadata with custom field options.
*
* @return array
* API result array
);
try{
- $result = civicrm_api3('contact', 'GetFields', $params);
+ $result = civicrm_api3('Contact', 'getfields', $params);
}
catch (CiviCRM_API3_Exception $e) {
// Handle error here.
'name' => 'external_identifier',
'type' => 2,
'title' => 'External Identifier',
- 'maxlength' => 32,
+ 'maxlength' => 64,
'size' => 8,
'import' => TRUE,
'where' => 'civicrm_contact.external_identifier',
'is_deceased' => array(
'name' => 'is_deceased',
'type' => 16,
- 'title' => 'Is Deceased',
+ 'title' => 'Deceased',
'import' => TRUE,
'where' => 'civicrm_contact.is_deceased',
'headerPattern' => '/i(s\\s)?d(eceased)$/i',
'source' => array(
'name' => 'source',
'type' => 2,
- 'title' => 'Source of Contact Data',
+ 'title' => 'Contact Source',
'maxlength' => 255,
'size' => 30,
'import' => TRUE,
'extends_entity_column_id' => '',
'is_view' => 0,
'is_multiple' => 0,
- 'option_group_id' => '105',
+ 'option_group_id' => '106',
'date_format' => '',
'time_format' => '',
'is_required' => '1',
'title' => 'Current Employer',
'description' => 'Name of Current Employer',
'type' => 2,
+ 'name' => 'current_employer',
),
'dupe_check' => array(
'title' => 'Check for Duplicates',
'description' => 'Throw error if contact create matches dedupe rule',
+ 'name' => 'dupe_check',
),
),
);
return $expectedResult;
}
-/**
+/*
* This example has been generated from the API test suite.
-* The test that created it is called
-* testCustomFieldCreateWithOptionValues
-* and can be found in
+* The test that created it is called "testCustomFieldCreateWithOptionValues"
+* 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