+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
* @example RelationshipCreate.php Std Create example
*
* @return array API Result Array
* {@getfields relationship_create}
* @static void
* @access public
* @example RelationshipCreate.php Std Create example
*
* @return array API Result Array
* {@getfields relationship_create}
* @static void
* @access public
function civicrm_api3_relationship_get($params) {
$options = _civicrm_api3_get_options_from_params($params);
function civicrm_api3_relationship_get($params) {
$options = _civicrm_api3_get_options_from_params($params);
if(!empty($params['membership_type_id']) && empty($params['relationship_type_id'])) {
CRM_Contact_BAO_Relationship::membershipTypeToRelationshipTypes($params);
}
if(!empty($params['membership_type_id']) && empty($params['relationship_type_id'])) {
CRM_Contact_BAO_Relationship::membershipTypeToRelationshipTypes($params);
}
* take the input parameter list as specified in the data model and
* convert it into the same format that we use in QF and BAO object
*
* take the input parameter list as specified in the data model and
* convert it into the same format that we use in QF and BAO object
*
_civicrm_api3_store_values($fields, $params, $values);
$relationTypes = CRM_Core_PseudoConstant::relationshipType('name');
_civicrm_api3_store_values($fields, $params, $values);
$relationTypes = CRM_Core_PseudoConstant::relationshipType('name');
$relation = new CRM_Contact_BAO_Relationship();
$relation->id = $params['id'];
if (!$relation->find(TRUE)) {
$relation = new CRM_Contact_BAO_Relationship();
$relation->id = $params['id'];
if (!$relation->find(TRUE)) {
$relationshipTypeId != $values['relationship_type_id']
) {
throw new Exception('Mismatched Relationship Type and Relationship Type Id');
$relationshipTypeId != $values['relationship_type_id']
) {
throw new Exception('Mismatched Relationship Type and Relationship Type Id');