infra updated incorrectly set public functions to private on payment classes
[civicrm-core.git] / api / v3 / examples / Domain / Create.php
1 <?php
2 /**
3 * @file
4 * Test Generated API Example.
5 * See bottom of this file for more detail.
6 */
7
8 /**
9 * Test Generated example of using domain create API.
10 *
11 *
12 * @return array
13 * API result array
14 */
15 function domain_create_example() {
16 $params = array(
17 'name' => 'A-team domain',
18 'description' => 'domain of chaos',
19 'domain_version' => '4.2',
20 'contact_id' => 6,
21 );
22
23 try{
24 $result = civicrm_api3('domain', 'create', $params);
25 }
26 catch (CiviCRM_API3_Exception $e) {
27 // Handle error here.
28 $errorMessage = $e->getMessage();
29 $errorCode = $e->getErrorCode();
30 $errorData = $e->getExtraParams();
31 return array(
32 'error' => $errorMessage,
33 'error_code' => $errorCode,
34 'error_data' => $errorData,
35 );
36 }
37
38 return $result;
39 }
40
41 /**
42 * Function returns array of result expected from previous function.
43 *
44 * @return array
45 * API result array
46 */
47 function domain_create_expectedresult() {
48
49 $expectedResult = array(
50 'is_error' => 0,
51 'version' => 3,
52 'count' => 1,
53 'id' => 3,
54 'values' => array(
55 '3' => array(
56 'id' => '3',
57 'name' => 'A-team domain',
58 'description' => 'domain of chaos',
59 'config_backend' => '',
60 'version' => '4.2',
61 'contact_id' => '6',
62 'locales' => '',
63 'locale_custom_strings' => '',
64 ),
65 ),
66 );
67
68 return $expectedResult;
69 }
70
71 /**
72 * This example has been generated from the API test suite.
73 * The test that created it is called
74 * testCreate
75 * and can be found in
76 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/DomainTest.php
77 *
78 * You can see the outcome of the API tests at
79 * https://test.civicrm.org/job/CiviCRM-master-git/
80 *
81 * To Learn about the API read
82 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
83 *
84 * Browse the api on your own site with the api explorer
85 * http://MYSITE.ORG/path/to/civicrm/api/explorer
86 *
87 * Read more about testing here
88 * http://wiki.civicrm.org/confluence/display/CRM/Testing
89 *
90 * API Standards documentation:
91 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
92 */