584520ce63fbe5f5f77265aeabe346ef55890e05
[civicrm-core.git] / api / v3 / examples / LocBlockCreate.php
1 <?php
2
3 /*
4
5 */
6 function loc_block_create_example(){
7 $params = array(
8 'version' => 3,
9 'address_id' => 2,
10 'phone_id' => 2,
11 'email_id' => 3,
12 );
13
14 $result = civicrm_api( 'loc_block','create',$params );
15
16 return $result;
17 }
18
19 /*
20 * Function returns array of result expected from previous function
21 */
22 function loc_block_create_expectedresult(){
23
24 $expectedResult = array(
25 'is_error' => 0,
26 'version' => 3,
27 'count' => 1,
28 'id' => 2,
29 'values' => array(
30 '2' => array(
31 'id' => '2',
32 'address_id' => '2',
33 'email_id' => '3',
34 'phone_id' => '2',
35 'im_id' => '',
36 'address_2_id' => '',
37 'email_2_id' => '',
38 'phone_2_id' => '',
39 'im_2_id' => '',
40 ),
41 ),
42 );
43
44 return $expectedResult ;
45 }
46
47
48 /*
49 * This example has been generated from the API test suite. The test that created it is called
50 *
51 * testCreateLocBlock and can be found in
52 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/LocBlockTest.php
53 *
54 * You can see the outcome of the API tests at
55 * http://tests.dev.civicrm.org/trunk/results-api_v3
56 *
57 * To Learn about the API read
58 * http://book.civicrm.org/developer/current/techniques/api/
59 *
60 * and review the wiki at
61 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
62 *
63 * Read more about testing here
64 * http://wiki.civicrm.org/confluence/display/CRM/Testing
65 *
66 * API Standards documentation:
67 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
68 */