Merge pull request #1046 from colemanw/showHide
[civicrm-core.git] / api / v3 / examples / Setting / CreateSettingCurrentDomain.php
CommitLineData
6a488035
TO
1<?php
2
3/*
4 shows setting a variable for a current domain
5 */
6function setting_create_example(){
53ca8fd7 7$params = array(
6a488035
TO
8 'version' => 3,
9 'uniq_email_per_site' => 1,
10);
11
12 $result = civicrm_api( 'setting','create',$params );
13
14 return $result;
15}
16
17/*
18 * Function returns array of result expected from previous function
19 */
20function setting_create_expectedresult(){
21
53ca8fd7 22 $expectedResult = array(
6a488035
TO
23 'is_error' => 0,
24 'version' => 3,
25 'count' => 1,
26 'id' => 1,
53ca8fd7 27 'values' => array(
28 '1' => array(
6a488035
TO
29 'uniq_email_per_site' => '1',
30 ),
31 ),
32);
33
34 return $expectedResult ;
35}
36
37
38/*
39* This example has been generated from the API test suite. The test that created it is called
40*
41* testCreateSetting and can be found in
42* http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/SettingTest.php
43*
44* You can see the outcome of the API tests at
45* http://tests.dev.civicrm.org/trunk/results-api_v3
46*
47* To Learn about the API read
48* http://book.civicrm.org/developer/current/techniques/api/
49*
50* and review the wiki at
51* http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
52*
53* Read more about testing here
54* http://wiki.civicrm.org/confluence/display/CRM/Testing
55*
56* API Standards documentation:
57* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
58*/