Merge pull request #127 from dlobo/CRM-12100
[civicrm-core.git] / api / v3 / examples / PriceFieldValueCreate.php
1 <?php
2
3 /*
4
5 */
6 function price_field_value_create_example(){
7 $params = array(
8 'version' => 3,
9 'price_field_id' => 13,
10 'membership_type_id' => 5,
11 'name' => 'memType1',
12 'label' => 'memType1',
13 'amount' => 90,
14 'membership_num_terms' => 2,
15 'is_active' => 1,
16 'financial_type_id' => 2,
17 );
18
19 $result = civicrm_api( 'price_field_value','create',$params );
20
21 return $result;
22 }
23
24 /*
25 * Function returns array of result expected from previous function
26 */
27 function price_field_value_create_expectedresult(){
28
29 $expectedResult = array(
30 'is_error' => 0,
31 'version' => 3,
32 'count' => 1,
33 'id' => 10,
34 'values' => array(
35 '10' => array(
36 'id' => '10',
37 'price_field_id' => '13',
38 'name' => 'memType1',
39 'label' => 'memType1',
40 'description' => '',
41 'amount' => '90',
42 'count' => '',
43 'max_value' => '',
44 'weight' => '1',
45 'membership_type_id' => '5',
46 'membership_num_terms' => '2',
47 'is_default' => '',
48 'is_active' => '1',
49 'financial_type_id' => '2',
50 'deductible_amount' => '',
51 ),
52 ),
53 );
54
55 return $expectedResult ;
56 }
57
58
59 /*
60 * This example has been generated from the API test suite. The test that created it is called
61 *
62 * testCreatePriceFieldValuewithMultipleTerms and can be found in
63 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/PriceFieldValueTest.php
64 *
65 * You can see the outcome of the API tests at
66 * http://tests.dev.civicrm.org/trunk/results-api_v3
67 *
68 * To Learn about the API read
69 * http://book.civicrm.org/developer/current/techniques/api/
70 *
71 * and review the wiki at
72 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
73 *
74 * Read more about testing here
75 * http://wiki.civicrm.org/confluence/display/CRM/Testing
76 *
77 * API Standards documentation:
78 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
79 */