3 * Test Generated example of using price_field_value create API
6 function price_field_value_create_example(){
8 'price_field_id' => 13,
9 'membership_type_id' => 5,
11 'label' => 'memType1',
13 'membership_num_terms' => 2,
15 'financial_type_id' => 2,
19 $result = civicrm_api3('price_field_value', 'create', $params);
21 catch (CiviCRM_API3_Exception
$e) {
23 $errorMessage = $e->getMessage();
24 $errorCode = $e->getErrorCode();
25 $errorData = $e->getExtraParams();
26 return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
33 * Function returns array of result expected from previous function
35 function price_field_value_create_expectedresult(){
37 $expectedResult = array(
45 'price_field_id' => '13',
47 'label' => 'memType1',
53 'membership_type_id' => '5',
54 'membership_num_terms' => '2',
57 'financial_type_id' => '2',
58 'deductible_amount' => '',
59 'contribution_type_id' => '2',
64 return $expectedResult;
69 * This example has been generated from the API test suite. The test that created it is called
71 * testCreatePriceFieldValuewithMultipleTerms and can be found in
72 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PriceFieldValueTest.php
74 * You can see the outcome of the API tests at
75 * https://test.civicrm.org/job/CiviCRM-master-git/
77 * To Learn about the API read
78 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
80 * Browse the api on your own site with the api explorer
81 * http://MYSITE.ORG/path/to/civicrm/api/explorer
83 * Read more about testing here
84 * http://wiki.civicrm.org/confluence/display/CRM/Testing
86 * API Standards documentation:
87 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards