You are here

public function DevelEntityUpdatesCommands::entityUpdates in Devel Entity Updates 3.0.x

Same name and namespace in other branches
  1. 8.2 src/Commands/DevelEntityUpdatesCommands.php \Drupal\devel_entity_updates\Commands\DevelEntityUpdatesCommands::entityUpdates()
  2. 8 src/Commands/DevelEntityUpdatesCommands.php \Drupal\devel_entity_updates\Commands\DevelEntityUpdatesCommands::entityUpdates()
  3. 3.x src/Commands/DevelEntityUpdatesCommands.php \Drupal\devel_entity_updates\Commands\DevelEntityUpdatesCommands::entityUpdates()

Apply pending entity schema updates.

@command devel-entity-updates @aliases dentup, entup, entity-updates @option cache-clear Set to 0 to suppress normal cache clearing; the caller should then clear if needed. @bootstrap full

Parameters

array $options: Array of options.

1 call to DevelEntityUpdatesCommands::entityUpdates()
DevelEntityUpdatesCommands::doLegacyEntityUpdates in src/Commands/DevelEntityUpdatesCommands.php
Replaces the "entity-updates" command.

File

src/Commands/DevelEntityUpdatesCommands.php, line 60

Class

DevelEntityUpdatesCommands
Drush9 commands definitions.

Namespace

Drupal\devel_entity_updates\Commands

Code

public function entityUpdates($options = [
  'cache-clear' => TRUE,
]) {
  if (Drush::simulate()) {
    throw new \Exception(dt('entity-updates command does not support --simulate option.'));
  }
  if ($this
    ->doEntityUpdates() === FALSE) {
    return;
  }
  if (!empty($options['cache-clear'])) {
    $process = Drush::drush($this
      ->siteAliasManager()
      ->getSelf(), 'cache-rebuild');
    $process
      ->mustrun();
  }
  $this
    ->logger()
    ->success(dt('Finished performing updates.'));
}