Merge pull request #1226 from kurund/CRM-11137
[civicrm-core.git] / api / v3 / examples / SettingGetValue.php
1 <?php
2
3 /*
4 Demonstrates getvalue action - intended for runtime use as better caching than get
5 */
6 function setting_getvalue_example(){
7 $params = array(
8 'version' => 3,
9 'name' => 'petition_contacts',
10 'group' => 'Campaign Preferences',
11 );
12
13 $result = civicrm_api( 'setting','getvalue',$params );
14
15 return $result;
16 }
17
18 /*
19 * Function returns array of result expected from previous function
20 */
21 function setting_getvalue_expectedresult(){
22
23 $expectedResult = 'Petition Contacts';
24
25 return $expectedResult ;
26 }
27
28
29 /*
30 * This example has been generated from the API test suite. The test that created it is called
31 *
32 * testGetValue and can be found in
33 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/SettingTest.php
34 *
35 * You can see the outcome of the API tests at
36 * http://tests.dev.civicrm.org/trunk/results-api_v3
37 *
38 * To Learn about the API read
39 * http://book.civicrm.org/developer/current/techniques/api/
40 *
41 * and review the wiki at
42 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
43 *
44 * Read more about testing here
45 * http://wiki.civicrm.org/confluence/display/CRM/Testing
46 *
47 * API Standards documentation:
48 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
49 */