Documentation

CustomField.php

This api exposes CiviCRM custom field.

Table of Contents

Functions

civicrm_api3_custom_field_create()  : array<string|int, mixed>
Create a 'custom field' within a custom field group.
_civicrm_api3_custom_field_flush_static_caches()  : mixed
Flush static caches in functions that might have stored available custom fields.
_civicrm_api3_custom_field_create_spec()  : mixed
Adjust Metadata for Create action.
civicrm_api3_custom_field_delete()  : array<string|int, mixed>
Use this API to delete an existing custom field.
civicrm_api3_custom_field_get()  : array<string|int, mixed>
Use this API to get existing custom fields.
_civicrm_api3_custom_field_validate_field()  : array<string|int, mixed>|null
Helper function to validate custom field value.
civicrm_api3_custom_field_setvalue()  : array<string|int, mixed>
CRM-15191 - Hack to ensure the cache gets cleared after updating a custom field.
civicrm_api3_custom_field_getoptions()  : mixed

Functions

civicrm_api3_custom_field_create()

Create a 'custom field' within a custom field group.

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

We also empty the static var in the getfields function after deletion so that the field is available for us (getfields manages date conversion among other things

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

Array per getfields metadata.

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

API success array

_civicrm_api3_custom_field_flush_static_caches()

Flush static caches in functions that might have stored available custom fields.

_civicrm_api3_custom_field_flush_static_caches() : mixed

_civicrm_api3_custom_field_create_spec()

Adjust Metadata for Create action.

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

Array of parameters determined by getfields.

civicrm_api3_custom_field_delete()

Use this API to delete an existing custom field.

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

Array id of the field to be deleted.

Return values
array<string|int, mixed>

civicrm_api3_custom_field_get()

Use this API to get existing custom fields.

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

Array to search on.

Return values
array<string|int, mixed>

_civicrm_api3_custom_field_validate_field()

Helper function to validate custom field value.

_civicrm_api3_custom_field_validate_field(string $fieldName, mixed $value, array<string|int, mixed> $fieldDetails[, array<string|int, mixed> &$errors = [] ]) : array<string|int, mixed>|null
Parameters
$fieldName : string

Custom field name (eg: custom_8 ).

$value : mixed

Field value to be validate.

$fieldDetails : array<string|int, mixed>

Field Details.

$errors : array<string|int, mixed> = []

Collect validation errors.

Tags
todo

remove this function - not in use but need to review functionality before removing as it might be useful in wrapper layer

Return values
array<string|int, mixed>|null

Validation errors

civicrm_api3_custom_field_setvalue()

CRM-15191 - Hack to ensure the cache gets cleared after updating a custom field.

civicrm_api3_custom_field_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_custom_field_getoptions()

civicrm_api3_custom_field_getoptions(mixed $params) : mixed
Parameters
$params : mixed

        
On this page

Search results