當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CRM_Core_BAO_Domain::getChildGroupIds方法代碼示例

本文整理匯總了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;
 }
開發者ID:bhirsch,項目名稱:voipdev,代碼行數:13,代碼來源:Domain.php

示例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;
 }
開發者ID:JSProffitt,項目名稱:civicrm-website-org,代碼行數:39,代碼來源:Contact.php

示例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;
 }
開發者ID:ksecor,項目名稱:civicrm,代碼行數:34,代碼來源:Contact.php


注:本文中的CRM_Core_BAO_Domain::getChildGroupIds方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。