function gathercontent_install in GatherContent 8.5
Same name and namespace in other branches
- 8 gathercontent.install \gathercontent_install()
- 8.3 gathercontent.install \gathercontent_install()
- 8.4 gathercontent.install \gathercontent_install()
- 7.3 gathercontent.install \gathercontent_install()
Implements hook_install().
File
- ./
gathercontent.install, line 17 - Install and uninstall script for GatherContent module.
Code
function gathercontent_install() {
if (\Drupal::entityTypeManager()
->hasDefinition('taxonomy_term')) {
$entityFieldManager = \Drupal::service('entity_field.manager');
$definitions = $entityFieldManager
->getFieldStorageDefinitions('taxonomy_term');
if (!isset($definitions['gathercontent_option_ids'])) {
FieldStorageConfig::create([
'field_name' => 'gathercontent_option_ids',
'entity_type' => 'taxonomy_term',
'type' => 'string',
'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED,
'locked' => TRUE,
'persist_with_no_fields' => TRUE,
'settings' => [
'is_ascii' => FALSE,
'case_sensitive' => FALSE,
],
])
->save();
}
}
}