public function Module::getSchemaUpdates

public Module::getSchemaUpdates()

Returns available database schema updates once a new version is installed.

Return value

array

File

core/lib/Drupal/Core/Updater/Module.php, line 82

Class

Module
Defines a class for updating modules using Drupal\Core\FileTransfer\FileTransfer classes via authorize.php.

Namespace

Drupal\Core\Updater

Code

public function getSchemaUpdates() {
  require_once DRUPAL_ROOT . '/core/includes/install.inc';
  require_once DRUPAL_ROOT . '/core/includes/update.inc';

  if (!self::canUpdate($this->name)) {
    return array();
  }
  module_load_include('install', $this->name);

  if (!$updates = drupal_get_schema_versions($this->name)) {
    return array();
  }
  $modules_with_updates = update_get_update_list();
  if ($updates = $modules_with_updates[$this->name]) {
    if ($updates['start']) {
      return $updates['pending'];
    }
  }
  return array();
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Updater!Module.php/function/Module::getSchemaUpdates/8.1.x