3 * Test Generated example of using website getfields API
6 function website_getfields_example(){
12 $result = civicrm_api3('website', 'getfields', $params);
14 catch (CiviCRM_API3_Exception
$e) {
16 $errorMessage = $e->getMessage();
17 $errorCode = $e->getErrorCode();
18 $errorData = $e->getExtraParams();
19 return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
26 * Function returns array of result expected from previous function
28 function website_getfields_expectedresult(){
30 $expectedResult = array(
38 'title' => 'Website ID',
40 'api.aliases' => array(
44 'contact_id' => array(
45 'name' => 'contact_id',
48 'FKClassName' => 'CRM_Contact_DAO_Contact',
57 'where' => 'civicrm_website.url',
58 'headerPattern' => '/Website/i',
59 'dataPattern' => '/^[A-Za-z][0-9A-Za-z]{20,}$/',
62 'website_type_id' => array(
63 'name' => 'website_type_id',
65 'title' => 'Website Type',
66 'pseudoconstant' => array(
67 'optionGroupName' => 'website_type',
73 return $expectedResult;
78 * This example has been generated from the API test suite. The test that created it is called
80 * testGetFields and can be found in
81 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/WebsiteTest.php
83 * You can see the outcome of the API tests at
84 * https://test.civicrm.org/job/CiviCRM-master-git/
86 * To Learn about the API read
87 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
89 * Browse the api on your own site with the api explorer
90 * http://MYSITE.ORG/path/to/civicrm/api/explorer
92 * Read more about testing here
93 * http://wiki.civicrm.org/confluence/display/CRM/Testing
95 * API Standards documentation:
96 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards