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


PHP CRM_Contact_BAO_Relationship::membershipTypeToRelationshipTypes方法代碼示例

本文整理匯總了PHP中CRM_Contact_BAO_Relationship::membershipTypeToRelationshipTypes方法的典型用法代碼示例。如果您正苦於以下問題:PHP CRM_Contact_BAO_Relationship::membershipTypeToRelationshipTypes方法的具體用法?PHP CRM_Contact_BAO_Relationship::membershipTypeToRelationshipTypes怎麽用?PHP CRM_Contact_BAO_Relationship::membershipTypeToRelationshipTypes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CRM_Contact_BAO_Relationship的用法示例。


在下文中一共展示了CRM_Contact_BAO_Relationship::membershipTypeToRelationshipTypes方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: civicrm_api3_relationship_get

/**
 * Function to get the relationship
 *
 * @param array   $params input parameters.
 * @todo  Result is inconsistent depending on whether contact_id is passed in :
 * -  if you pass in contact_id - it just returns all relationships for 'contact_id'
 * -  if you don't pass in contact_id then it does a filter on the relationship table (DAO based search)
 *
 * @return  Array API Result Array
 * {@getfields relationship_get}
 * @example RelationshipGet.php
 * @access  public
 */
function civicrm_api3_relationship_get($params)
{
    $options = _civicrm_api3_get_options_from_params($params);
    if (empty($params['contact_id'])) {
        if (!empty($params['membership_type_id']) && empty($params['relationship_type_id'])) {
            CRM_Contact_BAO_Relationship::membershipTypeToRelationshipTypes($params);
        }
        $relationships = _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params, FALSE);
    } else {
        $relationships = array();
        $relationships = CRM_Contact_BAO_Relationship::getRelationship($params['contact_id'], CRM_Utils_Array::value('status_id', $params), 0, CRM_Utils_Array::value('is_count', $options), CRM_Utils_Array::value('id', $params), NULL, NULL, FALSE, $params);
    }
    //perhaps we should add a 'getcount' but at this stage lets just handle getcount output
    if ($options['is_count']) {
        return array('count' => $relationships);
    }
    foreach ($relationships as $relationshipId => $values) {
        _civicrm_api3_custom_data_get($relationships[$relationshipId], 'Relationship', $relationshipId, NULL, CRM_Utils_Array::value('relationship_type_id', $values));
    }
    return civicrm_api3_create_success($relationships, $params);
}
開發者ID:prashantgajare,項目名稱:civicrm-core,代碼行數:34,代碼來源:Relationship.php


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