3 * Test Generated example demonstrating the Website.getfields API.
8 function website_getfields_example() {
14 $result = civicrm_api3('Website', 'getfields', $params);
16 catch (CiviCRM_API3_Exception
$e) {
18 $errorMessage = $e->getMessage();
19 $errorCode = $e->getErrorCode();
20 $errorData = $e->getExtraParams();
23 'error_message' => $errorMessage,
24 'error_code' => $errorCode,
25 'error_data' => $errorData,
33 * Function returns array of result expected from previous function.
38 function website_getfields_expectedresult() {
40 $expectedResult = array(
48 'title' => 'Website ID',
49 'description' => 'Unique Website ID',
51 'table_name' => 'civicrm_website',
52 'entity' => 'Website',
53 'bao' => 'CRM_Core_BAO_Website',
54 'api.aliases' => array(
58 'contact_id' => array(
59 'name' => 'contact_id',
62 'description' => 'FK to Contact ID',
63 'table_name' => 'civicrm_website',
64 'entity' => 'Website',
65 'bao' => 'CRM_Core_BAO_Website',
66 'FKClassName' => 'CRM_Contact_DAO_Contact',
67 'FKApiName' => 'Contact',
73 'description' => 'Website',
77 'where' => 'civicrm_website.url',
78 'headerPattern' => '/Website/i',
79 'dataPattern' => '/^[A-Za-z][0-9A-Za-z]{20,}$/',
81 'table_name' => 'civicrm_website',
82 'entity' => 'Website',
83 'bao' => 'CRM_Core_BAO_Website',
90 'website_type_id' => array(
91 'name' => 'website_type_id',
93 'title' => 'Website Type',
94 'description' => 'Which Website type does this website belong to.',
95 'table_name' => 'civicrm_website',
96 'entity' => 'Website',
97 'bao' => 'CRM_Core_BAO_Website',
103 'pseudoconstant' => array(
104 'optionGroupName' => 'website_type',
105 'optionEditPath' => 'civicrm/admin/options/website_type',
111 return $expectedResult;
115 * This example has been generated from the API test suite.
116 * The test that created it is called "testGetFields"
117 * and can be found at:
118 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/WebsiteTest.php
120 * You can see the outcome of the API tests at
121 * https://test.civicrm.org/job/CiviCRM-master-git/
123 * To Learn about the API read
124 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
126 * Browse the api on your own site with the api explorer
127 * http://MYSITE.ORG/path/to/civicrm/api
129 * Read more about testing here
130 * http://wiki.civicrm.org/confluence/display/CRM/Testing
132 * API Standards documentation:
133 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards