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