class CRM_Core_BAO_CustomValueTable

Methods

static 
create(array $customParams, string $parentOperation = NULL)

No description

static string
fieldToSQLType(string $type, int $maxLength = 255)

Given a field return the mysql data type associated with it.

static 
store(array $params, $entityTable, int $entityID, string $parentOperation = NULL)

No description

static 
postProcess(array $params, $entityTable, int $entityID, $customFieldExtends)

Post process function.

static array
getEntityValues(int $entityID, string $entityType = NULL, array $fieldIDs = NULL, bool $formatMultiRecordField = FALSE, array $DTparams = NULL)

Return an array of all custom values associated with an entity.

static array
setValues(array $params)

Take in an array of entityID, custom_XXX => value and set the value in the appropriate table. Should also be able to set the value to null. Follows api parameter/return conventions

static array
getValues(array $params)

Take in an array of entityID, custom_ID and gets the value from the appropriate table.

Details

at line 47
static create(array $customParams, string $parentOperation = NULL)

Parameters

array $customParams
string $parentOperation Operation being taken on the parent entity. If we know the parent entity is doing an insert we can skip the ON DUPLICATE UPDATE - which improves performance and reduces deadlocks. - edit - create

Exceptions

Exception

at line 296
static string fieldToSQLType(string $type, int $maxLength = 255)

Given a field return the mysql data type associated with it.

Parameters

string $type
int $maxLength

Return Value

string the mysql data store placeholder

at line 351
static store(array $params, $entityTable, int $entityID, string $parentOperation = NULL)

Parameters

array $params
$entityTable
int $entityID
string $parentOperation Operation being taken on the parent entity. If we know the parent entity is doing an insert we can skip the ON DUPLICATE UPDATE - which improves performance and reduces deadlocks. - edit - create

at line 400
static postProcess(array $params, $entityTable, int $entityID, $customFieldExtends)

Post process function.

Parameters

array $params
$entityTable
int $entityID
$customFieldExtends

at line 435
static array getEntityValues(int $entityID, string $entityType = NULL, array $fieldIDs = NULL, bool $formatMultiRecordField = FALSE, array $DTparams = NULL)

Return an array of all custom values associated with an entity.

Parameters

int $entityID Identification number of the entity.
string $entityType Type of entity that the entityID corresponds to, specified. as a string with format "''". Comma separated list may be used to specify OR matches. Allowable values are enumerated types in civicrm_custom_group.extends field. Optional. Default value assumes entityID references a contact entity.
array $fieldIDs Optional list of fieldIDs that we want to retrieve. If this. is set the entityType is ignored
bool $formatMultiRecordField
array $DTparams
  • CRM-17810 dataTable params for the multiValued custom fields.

Return Value

array Array of custom values for the entity with key=>value pairs specified as civicrm_custom_field.id => custom value. Empty array if no custom values found.

at line 547
static array setValues(array $params)

Take in an array of entityID, custom_XXX => value and set the value in the appropriate table. Should also be able to set the value to null. Follows api parameter/return conventions

Parameters

array $params

Return Value

array

Exceptions

Exception

at line 698
static array getValues(array $params)

Take in an array of entityID, custom_ID and gets the value from the appropriate table.

To get the values of custom fields with IDs 13 and 43 for contact ID 1327, use: $params = array( 'entityID' => 1327, 'custom_13' => 1, 'custom_43' => 1 );

Entity Type will be inferred by the custom fields you request Specify $params['entityType'] if you do not supply any custom fields to return and entity type is other than Contact

Parameters

array $params

Return Value

array

Exceptions

Exception