You are here

function _media_entity_get_bundles_using_exif in Media entity 8.2

Checks whether this site has image types with EXIF handling enabled.

Return value

string[] The media bundle IDs which have the EXIF handling enabled, or an empty array if none have it so.

2 calls to _media_entity_get_bundles_using_exif()
CliService::validateDbUpdateRequirements in src/CliService.php
Verify if the upgrade to Media in core is possible.
media_entity_update_8201 in ./media_entity.install
Replace Media Entity with Media.

File

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

Code

function _media_entity_get_bundles_using_exif() {
  $bundles = [];
  foreach (_media_entity_get_bundles_by_plugin('image') as $bundle_name) {
    $gather_exif = \Drupal::config("media_entity.bundle.{$bundle_name}")
      ->get('type_configuration.gather_exif');
    if ($gather_exif) {
      $bundles[] = $bundle_name;
    }
  }
  return $bundles;
}