You are here

function hook_acquia_contenthub_field_type_mapping_alter in Acquia Content Hub 8

Alter the field type mapping that maps field types to Content Hub types.

Modules may implement this hook to alter the field type mapping. This is used to tell Acquia Content Hub which Drupal field type maps to which data type in Acquia Content Hub so that it correctly stores it and it allows for better filtering, searching and storage.

Be careful with altering existing field types as it could severely damage the content in your Acquia Content Hub account.

Parameters

array $mapping: The mapping of field types to their Content Hub Types. Example: $mapping = [ 'entity_reference => 'array<reference>', 'integer' => 'array<integer>', 'timespan' => 'array<integer>', 'timestamp' => 'array<integer>', ... ]; Available Content Hub Types, all are also available as multiple.

  • integer
  • string
  • boolean
  • reference
  • number.

See also

\Drupal\acquia_contenthub\Normalizer\ContentEntityNormalizer

1 invocation of hook_acquia_contenthub_field_type_mapping_alter()
ContentEntityCdfNormalizer::getFieldTypeMapping in src/Normalizer/ContentEntityCdfNormalizer.php
Retrieves the mapping for known data types to Content Hub's internal types.

File

./acquia_contenthub.api.php, line 226
Hooks provided by the Acquia Content Hub module.

Code

function hook_acquia_contenthub_field_type_mapping_alter(array &$mapping) {
  $mapping['my_custom_field'] = 'array<string>';
}