You are here

function _media_entity_check_entity_version in Media entity 8

Same name and namespace in other branches
  1. 8.2 media_entity.install \_media_entity_check_entity_version()

Checks if required version of the Entity API is installed.

Return value

bool TRUE if dependency is met and FALSE if not.

2 calls to _media_entity_check_entity_version()
media_entity_requirements in ./media_entity.install
Implements hook_requirements().
media_entity_update_8003 in ./media_entity.install
Ensure Entity API is installed.

File

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

Code

function _media_entity_check_entity_version() {
  if (\Drupal::moduleHandler()
    ->moduleExists('entity')) {
    $info = system_get_info('module', 'entity');

    // Do not attempt version checks on development versions, which don't have
    // a version tag.
    if (empty($info['version']) || version_compare($info['version'], '8.x-1.0-alpha3') >= 0) {
      return TRUE;
    }
  }
  return FALSE;
}