|
Contents
Relationship API
civicrm_relationship_create(&$params )Availability: 1.8v Creates a new relationship between two contacts, and returns the newly created relationship object. CRM includes a default set of reserved relationship types (e.g. 'Household Member, "Employee", "Parent", etc.) - and supports creation of custom relationship types. By convention, 'contact_a' is the subject, and the 'contact_b' is the object of the relationship. For example, Jane Stein ('contact_a') is a 'Household Member' ('relationship_type') of 'The Stein Family' ('contact_b' whose contact_type is 'Household'). The relationship_type is a relationship type string reserved relationship types . A 'duplicate relationship' error is returned if there is already of relationship of the specified type between the two contacts. An error is also returned if either contact is invalid, or the specified relationship_type is not applicable to the type(s) of the Contacts. Parameters:
Returns:
civicrm_contact_relationship_get($params_contact_a, $params_contact_b = NULL, $relationship_type_name = array(), $sort = NULL)Availability: 1.8v Returns array of contacts related to contact_a. If contact_b is passed, only relationships between the two contacts are returned. NOTE: CRM will evaluate and retrieve relationships betweeen Contact a and Contact b regardless of whether they occupy the 'A' or 'B' slot in the Relationship object. If 'relationship_type' is specified as an array of strings, relationship(s) returned are limited to those of the specified type. Otherwise all related contacts are returned. Use 'return_properties' to constrain the contact properties included in the returned Contact object(s). Parameters:
Returns:
civicrm_relationship_get(&$params)Gets all the relationship(s) for a specified contact. This function is a simple wrapper to civicrm_contact_relationship_get Parameters:
Returns:
civicrm_relationship_delete(&$params)Availability: 1.8v Deletes the specified relationship Parameters:
Returns:
civicrm_relationship_type_add($params)Availability: 1.2v Adds a new relationship_type definition for a specified contact type. See Data Model for required values for the 'Relationship_type'. Parameters:
Returns:
civicrm_relationship_type_delete()Availability: 1.8v Deletes the specified relationship type Parameters:
Returns:
civicrm_relationship_types_get()Availability: 1.8v Returns array of relationship Type related to passing agrument. If array is empty, then all relationship Type returned in array. Returns:
|
Relationship APIs
Labels
