7c1410f0ec5b924321c98dbbd52978d0e2a522aa
3 * Test Generated example demonstrating the LocBlock.create API.
5 * Create locBlock with existing entities
10 function loc_block_create_example() {
18 $result = civicrm_api3('LocBlock', 'create', $params);
20 catch (CiviCRM_API3_Exception
$e) {
22 $errorMessage = $e->getMessage();
23 $errorCode = $e->getErrorCode();
24 $errorData = $e->getExtraParams();
26 'error' => $errorMessage,
27 'error_code' => $errorCode,
28 'error_data' => $errorData,
36 * Function returns array of result expected from previous function.
41 function loc_block_create_expectedresult() {
43 $expectedResult = array(
63 return $expectedResult;
67 * This example has been generated from the API test suite.
68 * The test that created it is called "testCreateLocBlock"
69 * and can be found at:
70 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/LocBlockTest.php
72 * You can see the outcome of the API tests at
73 * https://test.civicrm.org/job/CiviCRM-master-git/
75 * To Learn about the API read
76 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
78 * Browse the api on your own site with the api explorer
79 * http://MYSITE.ORG/path/to/civicrm/api
81 * Read more about testing here
82 * http://wiki.civicrm.org/confluence/display/CRM/Testing
84 * API Standards documentation:
85 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards