本文整理汇总了PHP中CRM_Contact_BAO_Group::getGroupContacts方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Contact_BAO_Group::getGroupContacts方法的具体用法?PHP CRM_Contact_BAO_Group::getGroupContacts怎么用?PHP CRM_Contact_BAO_Group::getGroupContacts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Contact_BAO_Group
的用法示例。
在下文中一共展示了CRM_Contact_BAO_Group::getGroupContacts方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testForceMailchimpToCiviSync
function testForceMailchimpToCiviSync()
{
$mailchimp_export_url = __DIR__ . '/../../../sample_mailchimp_export.txt';
$mailchimp_export_url = 'file:///' . realpath($mailchimp_export_url);
$mailchimp_sync_setting = CRM_CiviMailchimp_BAO_SyncSettingsTest::createTestGroupAndSyncSettings('Test Group testForceMailchimpToCiviSync');
$mailchimp_members = CRM_CiviMailchimp_Form_Sync::forceMailchimpToCiviSync($mailchimp_export_url, $mailchimp_sync_setting);
$contacts = CRM_Contact_BAO_Group::getGroupContacts($mailchimp_sync_setting->civicrm_group_id);
$this->assertCount(3, $mailchimp_members);
$this->assertCount(3, $contacts);
}
示例2: testContactReference
/**
* Test to check contact reference field
*/
public function testContactReference()
{
//create group
$groupId1 = $this->groupCreate();
$groupId2 = $this->groupCreate(array('name' => 'Test Group 2', 'domain_id' => 1, 'title' => 'New Test Group2 Created', 'description' => 'New Test Group2 Created', 'is_active' => 1, 'visibility' => 'User and User Admin Only'));
$contactIds = array();
foreach (array($groupId1, $groupId2) as $groupId) {
$this->groupContactCreate($groupId);
$contactIds = array_merge($contactIds, CRM_Contact_BAO_Group::getGroupContacts($groupId));
}
$contactIds = CRM_Utils_Array::collect('contact_id', $contactIds);
// create custom group with contact reference field
$customGroup = $this->customGroupCreate(array('extends' => 'Contact', 'title' => 'select_test_group'));
$params = array('custom_group_id' => $customGroup['id'], 'name' => 'Worker_Lookup', 'label' => 'Worker Lookup', 'filter' => "action=lookup&group={$groupId1},{$groupId2}", 'html_type' => 'Autocomplete-Select', 'data_type' => 'ContactReference', 'weight' => 4, 'is_searchable' => 1, 'is_active' => 1);
$customField = $this->callAPISuccess('custom_field', 'create', $params);
$_GET = array('id' => $customField['id'], 'is_unit_test' => TRUE);
$contactList = CRM_Contact_Page_AJAX::contactReference();
$contactList = CRM_Utils_Array::collect('id', $contactList);
//assert each returned contact id to be present in group contact
foreach ($contactList as $contactId) {
$this->assertTrue(in_array($contactId, $contactIds));
}
}
示例3: findTeamPlayers
private function findTeamPlayers()
{
// find contacts in this group
if (isset($this->_id)) {
$groupContacts = CRM_Contact_BAO_Group::getGroupContacts($this->_id);
if (count($groupContacts) > 0) {
$this->_contactIds = array();
foreach ($groupContacts as $groupContact) {
$this->_contactIds[] = $groupContact['contact_id'];
}
}
}
}