You are here

function _media_entity_get_base_field_overrides in Media entity 8.2

Gets all media base field overrides.

Return value

array[] The key is the field name where the override belongs to and the value is an array of all bundles the field is used in.

1 call to _media_entity_get_base_field_overrides()
media_entity_update_8201 in ./media_entity.install
Replace Media Entity with Media.

File

./media_entity.install, line 161
Install, uninstall and update hooks for Media entity module.

Code

function _media_entity_get_base_field_overrides() {
  $fields = [];
  $prefix = 'core.base_field_override.media.';
  foreach (\Drupal::configFactory()
    ->listAll($prefix) as $override) {
    list($bundle, $field) = explode('.', mb_substr($override, mb_strlen($prefix)));
    $fields[$field][] = $bundle;
  }
  return $fields;
}