Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
2 | ||
3 | /* | |
4 | demonstrates use of NOT IN filter | |
5 | */ | |
6 | function relationship_get_example(){ | |
26dcc9eb | 7 | $params = array( |
8 | 'relationship_type_id' => array( | |
9 | 'NOT IN' => array( | |
10 | '0' => 33, | |
11 | '1' => 34, | |
6a488035 TO |
12 | ), |
13 | ), | |
26dcc9eb | 14 | 'version' => 3, |
15 | 'debug' => 0, | |
6a488035 TO |
16 | ); |
17 | ||
18 | $result = civicrm_api( 'relationship','get',$params ); | |
19 | ||
20 | return $result; | |
21 | } | |
22 | ||
23 | /* | |
24 | * Function returns array of result expected from previous function | |
25 | */ | |
26 | function relationship_get_expectedresult(){ | |
27 | ||
26dcc9eb | 28 | $expectedResult = array( |
6a488035 TO |
29 | 'is_error' => 0, |
30 | 'version' => 3, | |
31 | 'count' => 2, | |
26dcc9eb | 32 | 'values' => array( |
33 | '1' => array( | |
6a488035 | 34 | 'id' => '1', |
26dcc9eb | 35 | 'contact_id_a' => '66', |
36 | 'contact_id_b' => '67', | |
37 | 'relationship_type_id' => '32', | |
6a488035 TO |
38 | 'start_date' => '2008-12-20', |
39 | 'is_active' => '1', | |
40 | 'description' => '', | |
41 | 'is_permission_a_b' => 0, | |
42 | 'is_permission_b_a' => 0, | |
6a488035 | 43 | ), |
26dcc9eb | 44 | '4' => array( |
6a488035 | 45 | 'id' => '4', |
26dcc9eb | 46 | 'contact_id_a' => '66', |
47 | 'contact_id_b' => '67', | |
48 | 'relationship_type_id' => '35', | |
6a488035 TO |
49 | 'start_date' => '2008-12-20', |
50 | 'is_active' => '1', | |
51 | 'description' => '', | |
52 | 'is_permission_a_b' => 0, | |
53 | 'is_permission_b_a' => 0, | |
6a488035 TO |
54 | ), |
55 | ), | |
56 | ); | |
57 | ||
58 | return $expectedResult ; | |
59 | } | |
60 | ||
61 | ||
62 | /* | |
63 | * This example has been generated from the API test suite. The test that created it is called | |
64 | * | |
65 | * testGetTypeOperators and can be found in | |
66 | * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/RelationshipTest.php | |
67 | * | |
68 | * You can see the outcome of the API tests at | |
69 | * http://tests.dev.civicrm.org/trunk/results-api_v3 | |
70 | * | |
71 | * To Learn about the API read | |
72 | * http://book.civicrm.org/developer/current/techniques/api/ | |
73 | * | |
74 | * and review the wiki at | |
75 | * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs | |
76 | * | |
77 | * Read more about testing here | |
78 | * http://wiki.civicrm.org/confluence/display/CRM/Testing | |
79 | * | |
80 | * API Standards documentation: | |
81 | * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards | |
82 | */ |