本文整理汇总了PHP中CRM_Core_BAO_Domain::getChildGroupIds方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_BAO_Domain::getChildGroupIds方法的具体用法?PHP CRM_Core_BAO_Domain::getChildGroupIds怎么用?PHP CRM_Core_BAO_Domain::getChildGroupIds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_BAO_Domain
的用法示例。
在下文中一共展示了CRM_Core_BAO_Domain::getChildGroupIds方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getContactList
static function getContactList()
{
$siteGroups = CRM_Core_BAO_Domain::getChildGroupIds();
$siteContacts = array();
if (!empty($siteGroups)) {
$query = "\nSELECT cc.id\nFROM civicrm_contact cc\nINNER JOIN civicrm_group_contact gc ON \n (gc.contact_id = cc.id AND gc.status = 'Added' AND gc.group_id IN (" . implode(',', $siteGroups) . "))";
$dao =& CRM_Core_DAO::executeQuery($query);
while ($dao->fetch()) {
$siteContacts[] = $dao->id;
}
}
return $siteContacts;
}
示例2: function_exists
/**
* Find the get contact details.
*
* This function does not respect ACLs for now, which might need to be rectified at some
* stage based on how its used.
*
* @param string $mail
* Primary email address of the contact.
* @param string $ctype
* Contact type.
*
* @return object
* $dao contact details
*/
public static function &matchContactOnEmail($mail, $ctype = NULL)
{
$strtolower = function_exists('mb_strtolower') ? 'mb_strtolower' : 'strtolower';
$mail = $strtolower(trim($mail));
$query = "\nSELECT civicrm_contact.id as contact_id,\n civicrm_contact.hash as hash,\n civicrm_contact.contact_type as contact_type,\n civicrm_contact.contact_sub_type as contact_sub_type\nFROM civicrm_contact\nINNER JOIN civicrm_email ON ( civicrm_contact.id = civicrm_email.contact_id )";
if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MULTISITE_PREFERENCES_NAME, 'uniq_email_per_site')) {
// try to find a match within a site (multisite).
$groups = CRM_Core_BAO_Domain::getChildGroupIds();
if (!empty($groups)) {
$query .= "\nINNER JOIN civicrm_group_contact gc ON\n(civicrm_contact.id = gc.contact_id AND gc.status = 'Added' AND gc.group_id IN (" . implode(',', $groups) . "))";
}
}
$query .= "\nWHERE civicrm_email.email = %1 AND civicrm_contact.is_deleted=0";
$p = array(1 => array($mail, 'String'));
if ($ctype) {
$query .= " AND civicrm_contact.contact_type = %3";
$p[3] = array($ctype, 'String');
}
$query .= " ORDER BY civicrm_email.is_primary DESC";
$dao = CRM_Core_DAO::executeQuery($query, $p);
if ($dao->fetch()) {
return $dao;
}
return CRM_Core_DAO::$_nullObject;
}
示例3: strtolower
/**
* Function to find the get contact details
*
* @param string $mail primary email address of the contact
* @param string $ctype contact type
*
* @return object $dao contact details
* @static
*/
static function &matchContactOnEmail($mail, $ctype = null)
{
$mail = strtolower(trim($mail));
$query = "\nSELECT civicrm_contact.id as contact_id,\n civicrm_contact.hash as hash,\n civicrm_contact.contact_type as contact_type,\n civicrm_contact.contact_sub_type as contact_sub_type\nFROM civicrm_contact\nINNER JOIN civicrm_email ON ( civicrm_contact.id = civicrm_email.contact_id )";
if (defined('CIVICRM_UNIQ_EMAIL_PER_SITE') && CIVICRM_UNIQ_EMAIL_PER_SITE) {
// try to find a match within a site (multisite).
require_once 'CRM/Core/BAO/Domain.php';
$groups = CRM_Core_BAO_Domain::getChildGroupIds();
if (!empty($groups)) {
$query .= "\nINNER JOIN civicrm_group_contact gc ON \n(civicrm_contact.id = gc.contact_id AND gc.group_id IN (" . implode(',', $groups) . "))";
}
}
$query .= " \nWHERE civicrm_email.email = %1";
$p = array(1 => array($mail, 'String'));
if ($ctype) {
$query .= " AND civicrm_contact.contact_type = %3";
$p[3] = array($ctype, 'String');
}
$query .= " ORDER BY civicrm_email.is_primary DESC";
$dao =& CRM_Core_DAO::executeQuery($query, $p);
if ($dao->fetch()) {
return $dao;
}
return CRM_Core_DAO::$_nullObject;
}