4 * Test Generated API Example.
5 * See bottom of this file for more detail.
9 * Test Generated example of using website get API.
11 * Demonostrates returning field metadata
16 function website_get_example() {
26 $result = civicrm_api3('website', 'get', $params);
28 catch (CiviCRM_API3_Exception
$e) {
30 $errorMessage = $e->getMessage();
31 $errorCode = $e->getErrorCode();
32 $errorData = $e->getExtraParams();
34 'error' => $errorMessage,
35 'error_code' => $errorCode,
36 'error_data' => $errorData,
44 * Function returns array of result expected from previous function.
49 function website_get_expectedresult() {
51 $expectedResult = array(
61 'title' => 'Website ID',
63 'api.aliases' => array(
67 'contact_id' => array(
68 'name' => 'contact_id',
71 'FKClassName' => 'CRM_Contact_DAO_Contact',
72 'FKApiName' => 'Contact',
81 'where' => 'civicrm_website.url',
82 'headerPattern' => '/Website/i',
83 'dataPattern' => '/^[A-Za-z][0-9A-Za-z]{20,}$/',
89 'website_type_id' => array(
90 'name' => 'website_type_id',
92 'title' => 'Website Type',
96 'pseudoconstant' => array(
97 'optionGroupName' => 'website_type',
104 return $expectedResult;
108 * This example has been generated from the API test suite.
109 * The test that created it is called
111 * and can be found in
112 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/WebsiteTest.php
114 * You can see the outcome of the API tests at
115 * https://test.civicrm.org/job/CiviCRM-master-git/
117 * To Learn about the API read
118 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
120 * Browse the api on your own site with the api explorer
121 * http://MYSITE.ORG/path/to/civicrm/api/explorer
123 * Read more about testing here
124 * http://wiki.civicrm.org/confluence/display/CRM/Testing
126 * API Standards documentation:
127 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards