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