You are here

protected function InPlaceUpdate::handleDatabaseUpdates in Automatic Updates 8

Handle database updates.

Return value

bool TRUE if database updates were handled successfully. FALSE otherwise.

Throws

\Drupal\Component\Plugin\Exception\PluginException

1 call to InPlaceUpdate::handleDatabaseUpdates()
InPlaceUpdate::update in src/Services/InPlaceUpdate.php
Update a project to the next release.

File

src/Services/InPlaceUpdate.php, line 643

Class

InPlaceUpdate
Class to apply in-place updates.

Namespace

Drupal\automatic_updates\Services

Code

protected function handleDatabaseUpdates() {
  $result = TRUE;

  /** @var \Drupal\Component\Plugin\PluginManagerInterface $database_update_handler */
  $database_update_handler = \Drupal::service('plugin.manager.database_update_handler');
  foreach ($this->configFactory
    ->get('automatic_updates.settings')
    ->get('database_update_handling') as $plugin_id) {
    $result = $result && $database_update_handler
      ->createInstance($plugin_id)
      ->execute();
  }
  return $result;
}