本文整理汇总了PHP中CRM_Contact_BAO_GroupContact::getGroupId方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Contact_BAO_GroupContact::getGroupId方法的具体用法?PHP CRM_Contact_BAO_GroupContact::getGroupId怎么用?PHP CRM_Contact_BAO_GroupContact::getGroupId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Contact_BAO_GroupContact
的用法示例。
在下文中一共展示了CRM_Contact_BAO_GroupContact::getGroupId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: del
/**
* function to remove/ rejoin the group
*
* @param int $groupContactId id of crm_group_contact
* @param string $status this is the status that should be updated.
*
* $access public
*/
function del($groupContactId, $status, $contactID)
{
$groupId = CRM_Contact_BAO_GroupContact::getGroupId($groupContactId);
switch ($status) {
case 'i':
$groupStatus = 'Added';
break;
case 'p':
$groupStatus = 'Pending';
break;
case 'o':
$groupStatus = 'Removed';
break;
}
$groupNum = CRM_Contact_BAO_GroupContact::getContactGroup($this->_contactId, 'Added', null, true, true);
if (defined('CIVICRM_MULTISITE') && CIVICRM_MULTISITE && $groupNum == 1 && $groupStatus == 'Removed') {
CRM_Core_Session::setStatus('make sure at least one contact group association is maintained.');
return false;
}
$ids = array($contactID);
$method = 'Admin';
$session =& CRM_Core_Session::singleton();
$userID = $session->get('userID');
if ($userID == $contactID) {
$method = 'Web';
}
CRM_Contact_BAO_GroupContact::removeContactsFromGroup($ids, $groupId, $method, $groupStatus);
}
示例2: del
/**
* function to remove/ rejoin the group
*
* @param int $groupContactId id of crm_group_contact
* @param string $status this is the status that should be updated.
*
* $access public
*/
function del($groupContactId, $status)
{
$groupContact =& new CRM_Contact_DAO_GroupContact();
$groupId = CRM_Contact_BAO_GroupContact::getGroupId($groupContactId);
switch ($status) {
case 'i':
$groupStatus = 'Added';
break;
case 'p':
$groupStatus = 'Pending';
break;
case 'o':
$groupStatus = 'Removed';
break;
}
$contactID = array($this->_contactId);
$method = 'Admin';
CRM_Contact_BAO_GroupContact::removeContactsFromGroup($contactID, $groupId, $method, $groupStatus);
}
示例3: del
/**
* function to remove/ rejoin the group
*
* @param int $groupContactId id of crm_group_contact
* @param string $status this is the status that should be updated.
*
* $access public
*/
static function del($groupContactId, $status, $contactID)
{
$groupId = CRM_Contact_BAO_GroupContact::getGroupId($groupContactId);
switch ($status) {
case 'i':
$groupStatus = 'Added';
break;
case 'p':
$groupStatus = 'Pending';
break;
case 'o':
$groupStatus = 'Removed';
break;
case 'd':
$groupStatus = 'Deleted';
break;
}
$groupNum = CRM_Contact_BAO_GroupContact::getContactGroup($contactID, 'Added', NULL, TRUE, TRUE);
if ($groupNum == 1 && $groupStatus == 'Removed' && CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MULTISITE_PREFERENCES_NAME, 'is_enabled')) {
CRM_Core_Session::setStatus(ts('Please ensure at least one contact group association is maintained.'), ts('Could Not Remove'));
return FALSE;
}
$ids = array($contactID);
$method = 'Admin';
$session = CRM_Core_Session::singleton();
$userID = $session->get('userID');
if ($userID == $contactID) {
$method = 'Web';
}
CRM_Contact_BAO_GroupContact::removeContactsFromGroup($ids, $groupId, $method, $groupStatus);
}