You are here

ConfigurationUpdateEvent.php in Update helper 8

Same filename and directory in other branches
  1. 2.x src/Events/ConfigurationUpdateEvent.php

File

src/Events/ConfigurationUpdateEvent.php
View source
<?php

namespace Drupal\update_helper\Events;

use Symfony\Component\EventDispatcher\Event;

/**
 * Event for configuration update execution.
 *
 * @package Drupal\update_helper\Events
 */
class ConfigurationUpdateEvent extends Event {

  /**
   * Module name.
   *
   * @var string
   */
  protected $module;

  /**
   * Update name.
   *
   * @var string
   */
  protected $updateName;

  /**
   * Count of warnings occurred during update execution.
   *
   * @var int
   */
  protected $warningCount;

  /**
   * Configuration update event.
   *
   * @param string $module
   *   Module name.
   * @param string $updateName
   *   Update name.
   * @param int $warningCount
   *   Count of warnings occurred during update execution.
   */
  public function __construct($module, $updateName, $warningCount) {
    $this->module = $module;
    $this->updateName = $updateName;
    $this->warningCount = $warningCount;
  }

  /**
   * Get module name.
   *
   * @return string
   *   Returns module name.
   */
  public function getModule() {
    return $this->module;
  }

  /**
   * Get update name.
   *
   * @return string
   *   Returns update name.
   */
  public function getUpdateName() {
    return $this->updateName;
  }

  /**
   * Get status for configuration update.
   *
   * @return bool
   *   Returns status for configuration update.
   */
  public function isSuccessful() {
    return $this->warningCount === 0;
  }

}

Classes

Namesort descending Description
ConfigurationUpdateEvent Event for configuration update execution.