function drupal_get_schema_versions

Same name in other branches
  1. 7.x includes/install.inc \drupal_get_schema_versions()
  2. 8.9.x core/includes/schema.inc \drupal_get_schema_versions()

Returns an array of available schema versions for a module.

Parameters

string $module: A module name.

Return value

array|bool If the module has updates, an array of available updates sorted by version. Otherwise, FALSE.

Deprecated

in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Drupal\Core\Update\SchemaDataInterface::getAvailableUpdates() instead.

See also

https://www.drupal.org/node/2444417

\Drupal\Core\Update\UpdateHookRegistry::getAvailableUpdates()

Related topics

1 call to drupal_get_schema_versions()
UpdateDeprecationTest::testDrupalGetSchemaVersionsLegacyTest in core/tests/Drupal/KernelTests/Core/Extension/UpdateDeprecationTest.php
Deprecation testing for drupal_get_schema_versions function.

File

core/includes/schema.inc, line 42

Code

function drupal_get_schema_versions($module) {
    @trigger_error('drupal_get_schema_versions() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \\Drupal\\Core\\Update\\UpdateHookRegistry::getAvailableUpdates() instead. See https://www.drupal.org/node/2444417', E_USER_DEPRECATED);
    return \Drupal::service('update.update_hook_registry')->getAvailableUpdates($module);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.