class RollbackUpdate in Automatic Updates 8
Rollback database updates.
Plugin annotation
@DatabaseUpdateHandler(
  id = "rollback",
  label = "Rollback database updates",
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface- class \Drupal\automatic_updates\DatabaseUpdateHandlerPluginBase implements DatabaseUpdateHandlerInterface- class \Drupal\automatic_updates\Plugin\DatabaseUpdateHandler\RollbackUpdate implements ContainerFactoryPluginInterface
 
 
- class \Drupal\automatic_updates\DatabaseUpdateHandlerPluginBase implements DatabaseUpdateHandlerInterface
Expanded class hierarchy of RollbackUpdate
File
- src/Plugin/ DatabaseUpdateHandler/ RollbackUpdate.php, line 18 
Namespace
Drupal\automatic_updates\Plugin\DatabaseUpdateHandlerView source
class RollbackUpdate extends DatabaseUpdateHandlerPluginBase implements ContainerFactoryPluginInterface {
  /**
   * The logger.
   *
   * @var \Psr\Log\LoggerInterface
   */
  protected $logger;
  /**
   * Constructs a new maintenance mode service.
   *
   * @param array $configuration
   *   A configuration array containing information about the plugin instance.
   * @param string $plugin_id
   *   The plugin_id for the plugin instance.
   * @param mixed $plugin_definition
   *   The plugin implementation definition.
   * @param \Psr\Log\LoggerInterface $logger
   *   The logger.
   */
  public function __construct(array $configuration, $plugin_id, $plugin_definition, LoggerInterface $logger) {
    parent::__construct($configuration, $plugin_id, $plugin_definition);
    $this->logger = $logger;
  }
  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
    return new static($configuration, $plugin_id, $plugin_definition, $container
      ->get('logger.channel.automatic_updates'));
  }
  /**
   * {@inheritdoc}
   */
  public function execute() {
    $this->logger
      ->notice('Rollback initiated due to database updates.');
    // Simply rollback the update by returning FALSE.
    return FALSE;
  }
}Members
| Name   | Modifiers | Type | Description | Overrides | 
|---|---|---|---|---|
| DatabaseUpdateHandlerPluginBase:: | public | function | Returns the translated plugin label. Overrides DatabaseUpdateHandlerInterface:: | |
| PluginBase:: | protected | property | Configuration information passed into the plugin. | 1 | 
| PluginBase:: | protected | property | The plugin implementation definition. | 1 | 
| PluginBase:: | protected | property | The plugin_id. | |
| PluginBase:: | constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
| PluginBase:: | public | function | Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: | |
| PluginBase:: | public | function | Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: | |
| PluginBase:: | public | function | Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: | 3 | 
| PluginBase:: | public | function | Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: | |
| PluginBase:: | public | function | Determines if the plugin is configurable. | |
| RollbackUpdate:: | protected | property | The logger. | |
| RollbackUpdate:: | public static | function | Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface:: | |
| RollbackUpdate:: | public | function | Handle database updates. Overrides DatabaseUpdateHandlerInterface:: | |
| RollbackUpdate:: | public | function | Constructs a new maintenance mode service. Overrides PluginBase:: | 
