3 * Test Generated example demonstrating the GroupContact.get API.
5 * Get all from group and display contacts.
10 function group_contact_get_example() {
18 $result = civicrm_api3('GroupContact', 'get', $params);
20 catch (CiviCRM_API3_Exception
$e) {
22 $errorMessage = $e->getMessage();
23 $errorCode = $e->getErrorCode();
24 $errorData = $e->getExtraParams();
27 'error_message' => $errorMessage,
28 'error_code' => $errorCode,
29 'error_data' => $errorData,
37 * Function returns array of result expected from previous function.
42 function group_contact_get_expectedresult() {
63 'name' => 'Test Group 1',
64 'title' => 'New Test Group Created',
65 'description' => 'New Test Group Created',
67 'visibility' => 'Public Pages',
68 'where_clause' => ' ( ( ( `civicrm_group_contact-5d5bbabeb0cbd`.group_id IN (\"3\") ) ) ) ',
69 'select_tables' => 'a:8:{s:15:\"civicrm_contact\";i:1;s:15:\"civicrm_address\";i:1;s:15:\"civicrm_country\";i:1;s:13:\"civicrm_email\";i:1;s:13:\"civicrm_phone\";i:1;s:10:\"civicrm_im\";i:1;s:19:\"civicrm_worldregion\";i:1;s:37:\"`civicrm_group_contact-5d5bbabeb0cbd`\";s:201:\" LEFT JOIN civicrm_group_contact `civicrm_group_contact-5d5bbabeb0cbd` ON (contact_a.id = `civicrm_group_contact-5d5bbabeb0cbd`.contact_id AND `civicrm_group_contact-5d5bbabeb0cbd`.status IN (\'Added\'))\";}',
70 'where_tables' => 'a:2:{s:15:\"civicrm_contact\";i:1;s:37:\"`civicrm_group_contact-5d5bbabeb0cbd`\";s:201:\" LEFT JOIN civicrm_group_contact `civicrm_group_contact-5d5bbabeb0cbd` ON (contact_a.id = `civicrm_group_contact-5d5bbabeb0cbd`.contact_id AND `civicrm_group_contact-5d5bbabeb0cbd`.status IN (\'Added\'))\";}',
84 return $expectedResult;
88 * This example has been generated from the API test suite.
89 * The test that created it is called "testGetGroupID"
90 * and can be found at:
91 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/GroupContactTest.php
93 * You can see the outcome of the API tests at
94 * https://test.civicrm.org/job/CiviCRM-Core-Matrix/
96 * To Learn about the API read
97 * https://docs.civicrm.org/dev/en/latest/api/
99 * Browse the API on your own site with the API Explorer. It is in the main
100 * CiviCRM menu, under: Support > Development > API Explorer.
102 * Read more about testing here
103 * https://docs.civicrm.org/dev/en/latest/testing/
105 * API Standards documentation:
106 * https://docs.civicrm.org/dev/en/latest/framework/api-architecture/