You are here

function menu_item_fields_set_config_dependencies in Menu item content fields 8

Set proper dependencies on the config entities created with this module.

5 calls to menu_item_fields_set_config_dependencies()
menu_item_fields_entity_form_display_presave in ./menu_item_fields.module
Implements hook_entity_form_display_presave().
menu_item_fields_entity_view_display_presave in ./menu_item_fields.module
Implements hook_entity_view_display_presave().
menu_item_fields_entity_view_mode_presave in ./menu_item_fields.module
Implements hook_entity_view_mode_presave().
menu_item_fields_field_config_presave in ./menu_item_fields.module
Implements hook_field_config_presave().
menu_item_fields_field_storage_config_presave in ./menu_item_fields.module
Implements hook_field_storage_config_presave().

File

./menu_item_fields.module, line 180
Contains hooks for the Menu Item Fields module.

Code

function menu_item_fields_set_config_dependencies(EntityInterface $entity) {
  $dependencies = $entity
    ->get('dependencies');
  if (array_search('menu_item_fields', $dependencies['module'] ?? []) === FALSE) {
    $dependencies['module'][] = 'menu_item_fields';
  }
  $entity
    ->set('dependencies', $dependencies);
}