class UpdateBase

Base class for an update.

Hierarchy

Expanded class hierarchy of UpdateBase

Related topics

Namespace

Drupal\bootstrap\Plugin\Update
Source
class UpdateBase extends PluginBase implements UpdateInterface {

  /**
   * {@inheritdoc}
   */
  public function getDescription() {
    return isset($this->pluginDefinition['description']) ? $this->pluginDefinition['description'] : NULL;
  }

  /**
   * {@inheritdoc}
   */
  public function getLabel() {
    return !empty($this->pluginDefinition['label']) ? $this->pluginDefinition['label'] : NULL;
  }

  /**
   * {@inheritdoc}
   */
  public function getProvider() {
    return isset($this->pluginDefinition['provider']) ? $this->pluginDefinition['provider'] : FALSE;
  }

  /**
   * {@inheritdoc}
   */
  public function getSchema() {
    return (int) $this->getPluginId();
  }

  /**
   * {@inheritdoc}
   */
  public function getSeverity() {
    return isset($this->pluginDefinition['severity']) ? $this->pluginDefinition['severity'] : FALSE;
  }

  /**
   * {@inheritdoc}
   */
  public function getTheme() {
    return Bootstrap::getTheme($this->pluginDefinition['provider']);
  }

  /**
   * {@inheritdoc}
   */
  public function isPrivate() {
    return !empty($this->pluginDefinition['private']);
  }

  /**
   * {@inheritdoc}
   */
  public function process(Theme $theme, array &$context) {
  }

  /*************************
   * Deprecated methods.
   *************************/

  /**
   * {@inheritdoc}
   *
   * @deprecated 8.x-3.0-rc2, will be removed before 8.x-3.0 is released.
   *
   * @see \Drupal\bootstrap\Plugin\Update\UpdateBase::getSeverity
   */
  public function getLevel() {
    return $this->getSeverity();
  }

  /**
   * {@inheritdoc}
   *
   * @deprecated 8.x-3.0-rc2, will be removed before 8.x-3.0 is released.
   *
   * @see \Drupal\bootstrap\Plugin\Update\UpdateBase::getLabel
   */
  public function getTitle() {
    return $this->getLabel();
  }

}

Members

Contains filters are case sensitive
Name Modifiers Type Description
PluginBase::$theme protected property The currently set theme object.
PluginBase::__construct public function
UpdateBase::getDescription public function Retrieves the update description, if any. Overrides UpdateInterface::getDescription
UpdateBase::getLabel public function Retrieves the human-readable label for the update. Overrides UpdateInterface::getLabel
UpdateBase::getLevel Deprecated public function
UpdateBase::getProvider public function Retrieves the provider. Overrides UpdateInterface::getProvider
UpdateBase::getSchema public function Retrieves the update schema. Overrides UpdateInterface::getSchema
UpdateBase::getSeverity public function Retrieves the update severity level. Overrides UpdateInterface::getSeverity
UpdateBase::getTheme public function Retrieves the theme that provided the update. Overrides UpdateInterface::getTheme
UpdateBase::getTitle Deprecated public function
UpdateBase::isPrivate public function Indicates whether or not the update is private. Overrides UpdateInterface::isPrivate
UpdateBase::process public function The batch process callback for the update. Overrides UpdateInterface::process