当前位置: 首页>>代码示例>>PHP>>正文


PHP CRM_Contact_BAO_Group::getGroups方法代码示例

本文整理汇总了PHP中CRM_Contact_BAO_Group::getGroups方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Contact_BAO_Group::getGroups方法的具体用法?PHP CRM_Contact_BAO_Group::getGroups怎么用?PHP CRM_Contact_BAO_Group::getGroups使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CRM_Contact_BAO_Group的用法示例。


在下文中一共展示了CRM_Contact_BAO_Group::getGroups方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: crm_get_groups

/**
 * Returns array of group object(s) matching a set of one or Group properties.
 *
 *
 * @param array       $param                 Array of one or more valid property_name=>value pairs. Limits the set of groups returned.
 * @param array       $returnProperties      Which properties should be included in the returned group objects. (member_count should be last element.)
 *  
 * @return  An array of group objects.
 *
 * @access public
 */
function crm_get_groups($params = null, $returnProperties = null)
{
    _crm_initialize();
    if ($returnProperties != null && !is_array($returnProperties)) {
        return _crm_error('$returnProperties is not an array');
    }
    if ($params != null && !is_array($params)) {
        return _crm_error('$params is not an array');
    }
    $groups = array();
    $groups = CRM_Contact_BAO_Group::getGroups($params, $returnProperties);
    return $groups;
}
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:24,代码来源:Group.php

示例2: civicrm_group_get

/**
 * Returns array of groups  matching a set of one or more group properties
 *
 * @param array $params  (referance) Array of one or more valid
 *                       property_name=>value pairs. If $params is set
 *                       as null, all groups will be returned
 *
 * @return array  (referance) Array of matching groups
 * @access public
 */
function civicrm_group_get(&$params)
{
    _civicrm_initialize();
    if (!is_null($params) && !is_array($params)) {
        return civicrm_create_error('Params should be array');
    }
    $returnProperties = array();
    foreach ($params as $n => $v) {
        if (substr($n, 0, 7) == 'return.') {
            $returnProperties[] = substr($n, 7);
        }
    }
    if (!empty($returnProperties)) {
        $returnProperties[] = 'id';
    }
    $groupObjects = CRM_Contact_BAO_Group::getGroups($params, $returnProperties);
    if (count($groupObjects) == 0) {
        return civicrm_create_error('No such group exists');
    }
    $groups = array();
    foreach ($groupObjects as $group) {
        _civicrm_object_to_array($group, $groups[$group->id]);
    }
    return $groups;
}
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:35,代码来源:Group.php

示例3: getContainingGroups

 /**
  * @param int $contactId
  * @param int $parentGroupId
  *
  * @return array
  */
 public static function getContainingGroups($contactId, $parentGroupId)
 {
     $groups = CRM_Contact_BAO_Group::getGroups();
     $containingGroups = array();
     foreach ($groups as $group) {
         if (self::isDescendentGroup($parentGroupId, $group->id)) {
             $members = CRM_Contact_BAO_Group::getMember($group->id);
             if ($members[$contactId]) {
                 $containingGroups[] = $group->title;
             }
         }
     }
     return $containingGroups;
 }
开发者ID:kidaa30,项目名称:yes,代码行数:20,代码来源:GroupNesting.php

示例4: civimailchimp_civicrm_post_Contact_delete

/**
 * Implements hook_civicrm_post for Individual and Organization delete.
 */
function civimailchimp_civicrm_post_Contact_delete($contact_id, &$contact)
{
    $params = array("contact_id" => $contact_id);
    $contact_groups = CRM_Contact_BAO_Group::getGroups($params);
    foreach ($contact_groups as $group) {
        civimailchimp_civicrm_contact_removed_from_group($group, $contact);
    }
}
开发者ID:jaapjansma,项目名称:com.giantrabbit.civimailchimp,代码行数:11,代码来源:civimailchimp.php

示例5: civicrm_api3_group_get

/**
 * Returns array of groups  matching a set of one or more group properties
 *
 * @param array $params  (referance) Array of one or more valid
 *                       property_name=>value pairs. If $params is set
 *                       as null, all groups will be returned
 *
 * @return array  Array of matching groups
 * @example GroupGet.php
 * {@getfields group_get}
 * @access public
 */
function civicrm_api3_group_get($params)
{
    $options = _civicrm_api3_get_options_from_params($params, TRUE, 'group', 'get');
    $sort = CRM_Utils_Array::value('sort', $options, NULL);
    $offset = CRM_Utils_Array::value('offset', $options);
    $rowCount = CRM_Utils_Array::value('limit', $options);
    $returnProperties = CRM_Utils_Array::value('return', $options, NULL);
    $inputParams = CRM_Utils_Array::value('input_params', $options, array());
    if (is_array($returnProperties) && !empty($returnProperties)) {
        // group function takes $returnProperties in non standard format & doesn't add id
        unset($returnProperties['group_id']);
        $returnProperties['id'] = 1;
        $returnProperties = array_keys($returnProperties);
    }
    if (!empty($inputParams['group_id'])) {
        $inputParams['id'] = $inputParams['group_id'];
    }
    $groupObjects = CRM_Contact_BAO_Group::getGroups($inputParams, $returnProperties, $sort, $offset, $rowCount);
    if (empty($groupObjects)) {
        return civicrm_api3_create_success(FALSE);
    }
    $groups = array();
    foreach ($groupObjects as $group) {
        _civicrm_api3_object_to_array($group, $groups[$group->id]);
        _civicrm_api3_custom_data_get($groups[$group->id], 'Group', $group->id);
    }
    return civicrm_api3_create_success($groups, $params, 'group', 'create');
}
开发者ID:hguru,项目名称:224Civi,代码行数:40,代码来源:Group.php

示例6: civicrm_api3_group_get

/**
 * Returns array of groups  matching a set of one or more group properties
 *
 * @param array $params  (referance) Array of one or more valid
 *                       property_name=>value pairs. If $params is set
 *                       as null, all groups will be returned
 *
 * @return array  Array of matching groups
 * @example GroupGet.php
 * {@getfields group_get}
 * @access public
 */
function civicrm_api3_group_get($params)
{
    $returnProperties = array();
    foreach ($params as $n => $v) {
        if (substr($n, 0, 7) == 'return.') {
            $returnProperties[] = substr($n, 7);
        }
    }
    if (!empty($returnProperties)) {
        $returnProperties[] = 'id';
    }
    $groupObjects = CRM_Contact_BAO_Group::getGroups($params, $returnProperties);
    if (empty($groupObjects)) {
        return civicrm_api3_create_success(FALSE);
    }
    $groups = array();
    foreach ($groupObjects as $group) {
        _civicrm_api3_object_to_array($group, $groups[$group->id]);
        _civicrm_api3_custom_data_get($groups[$group->id], 'Group', $group->id);
    }
    return civicrm_api3_create_success($groups, $params, 'group', 'create');
}
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:34,代码来源:Group.php


注:本文中的CRM_Contact_BAO_Group::getGroups方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。