Merge pull request #972 from deepak-srivastava/hr
[civicrm-core.git] / api / v3 / examples / UFJoinCreate.php
CommitLineData
6a488035
TO
1<?php
2
3/*
4
5 */
6function uf_join_create_example(){
7$params = array(
8 'module' => 'CiviContribute',
9 'entity_table' => 'civicrm_contribution_page',
10 'entity_id' => 1,
11 'weight' => 1,
12 'uf_group_id' => 11,
13 'is_active' => 1,
14 'version' => 3,
15 'sequential' => 1,
16);
17
18 $result = civicrm_api( 'uf_join','create',$params );
19
20 return $result;
21}
22
23/*
24 * Function returns array of result expected from previous function
25 */
26function uf_join_create_expectedresult(){
27
28 $expectedResult = array(
29 'is_error' => 0,
30 'version' => 3,
31 'count' => 1,
32 'id' => 0,
33 'values' => array(
34 '0' => array(
35 'id' => '1',
36 'is_active' => '1',
37 'module' => 'CiviContribute',
38 'entity_table' => 'civicrm_contribution_page',
39 'entity_id' => '1',
40 'weight' => '1',
41 'uf_group_id' => '11',
42 ),
43 ),
44);
45
46 return $expectedResult ;
47}
48
49
50/*
51* This example has been generated from the API test suite. The test that created it is called
52*
53* testCreateUFJoin and can be found in
54* http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/UFJoinTest.php
55*
56* You can see the outcome of the API tests at
57* http://tests.dev.civicrm.org/trunk/results-api_v3
58*
59* To Learn about the API read
60* http://book.civicrm.org/developer/current/techniques/api/
61*
62* and review the wiki at
63* http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
64*
65* Read more about testing here
66* http://wiki.civicrm.org/confluence/display/CRM/Testing
67*
68* API Standards documentation:
69* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
70*/