Documentation

Relationship.php

This api exposes CiviCRM relationships.

Table of Contents

Functions

civicrm_api3_relationship_create()  : array<string|int, mixed>
Add or update a relationship.
_civicrm_api3_relationship_create_spec()  : mixed
Adjust Metadata for Create action.
civicrm_api3_relationship_delete()  : array<string|int, mixed>
Delete a relationship.
civicrm_api3_relationship_get()  : array<string|int, mixed>
Get one or more relationship/s.
_civicrm_api3_handle_relationship_type()  : mixed
Legacy handling for relationship_type parameter.
civicrm_api3_relationship_setvalue()  : array<string|int, mixed>
Hack to ensure inherited membership got created/deleted on relationship add/delete respectively.
_civicrm_api3_relationship_getoptions_spec()  : mixed

Functions

civicrm_api3_relationship_create()

Add or update a relationship.

civicrm_api3_relationship_create(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
$params : array<string|int, mixed>

Input parameters.

Tags
throws
CRM_Core_Exception
Return values
array<string|int, mixed>

API Result Array

_civicrm_api3_relationship_create_spec()

Adjust Metadata for Create action.

_civicrm_api3_relationship_create_spec(array<string|int, mixed> &$params) : mixed
Parameters
$params : array<string|int, mixed>

Array of parameters determined by getfields.

civicrm_api3_relationship_delete()

Delete a relationship.

civicrm_api3_relationship_delete(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
$params : array<string|int, mixed>
Tags
throws
CRM_Core_Exception
Return values
array<string|int, mixed>

API Result Array

civicrm_api3_relationship_get()

Get one or more relationship/s.

civicrm_api3_relationship_get(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
$params : array<string|int, mixed>

Input parameters.

Tags
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 values
array<string|int, mixed>

API Result Array

_civicrm_api3_handle_relationship_type()

Legacy handling for relationship_type parameter.

_civicrm_api3_handle_relationship_type(array<string|int, mixed> &$params) : mixed
Parameters
$params : array<string|int, mixed>

Associative array of property name/value. pairs to insert in new contact.

civicrm_api3_relationship_setvalue()

Hack to ensure inherited membership got created/deleted on relationship add/delete respectively.

civicrm_api3_relationship_setvalue(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
$params : array<string|int, mixed>

Array per getfields metadata.

Return values
array<string|int, mixed>

_civicrm_api3_relationship_getoptions_spec()

_civicrm_api3_relationship_getoptions_spec(mixed &$params) : mixed
Parameters
$params : mixed

        
On this page

Search results