You are here

function _media_entity_check_entity_version in Media entity 8.2

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

Checks if required version of the Entity API is installed.

Return value

int REQUIREMENT_OK if dependency is met and REQUIREMENT_ERROR if not. REQUIREMENT_WARNING is returned if it can not be determined.

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 21
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');
    if (is_null($info['version'])) {
      return REQUIREMENT_WARNING;
    }
    if (version_compare($info['version'], '8.x-1.0-alpha3') >= 0) {
      return REQUIREMENT_ERROR;
    }
  }
  return REQUIREMENT_OK;
}