class ConfigurationUpdateSubscriber in Update helper 2.x
Same name and namespace in other branches
- 8 modules/update_helper_checklist/src/Events/ConfigurationUpdateSubscriber.php \Drupal\update_helper_checklist\Events\ConfigurationUpdateSubscriber
Configuration update subscriber.
@package Drupal\update_helper_checklist\Events
Hierarchy
- class \Drupal\update_helper_checklist\Events\ConfigurationUpdateSubscriber implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
Expanded class hierarchy of ConfigurationUpdateSubscriber
1 string reference to 'ConfigurationUpdateSubscriber'
- update_helper_checklist.services.yml in modules/
update_helper_checklist/ update_helper_checklist.services.yml - modules/update_helper_checklist/update_helper_checklist.services.yml
1 service uses ConfigurationUpdateSubscriber
File
- modules/
update_helper_checklist/ src/ Events/ ConfigurationUpdateSubscriber.php, line 15
Namespace
Drupal\update_helper_checklist\EventsView source
class ConfigurationUpdateSubscriber implements EventSubscriberInterface {
/**
* Update checklist service.
*
* @var \Drupal\update_helper_checklist\UpdateChecklist
*/
protected $updateChecklist;
/**
* ConfigurationUpdateSubscriber constructor.
*
* @param \Drupal\update_helper_checklist\UpdateChecklist $update_checklist
* Update checklist service.
*/
public function __construct(UpdateChecklist $update_checklist) {
$this->updateChecklist = $update_checklist;
}
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents() {
return [
UpdateHelperEvents::CONFIGURATION_UPDATE => [
[
'onConfigurationUpdate',
10,
],
],
];
}
/**
* Handles on configuration update event.
*
* @param \Drupal\update_helper\Events\ConfigurationUpdateEvent $event
* Configuration update event.
*
* @throws \Drupal\Core\Entity\EntityStorageException
*/
public function onConfigurationUpdate(ConfigurationUpdateEvent $event) {
if ($event
->isSuccessful()) {
$this->updateChecklist
->markUpdatesSuccessful([
$event
->getModule() => [
$event
->getUpdateName(),
],
]);
}
else {
$this->updateChecklist
->markUpdatesFailed([
$event
->getModule() => [
$event
->getUpdateName(),
],
]);
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ConfigurationUpdateSubscriber:: |
protected | property | Update checklist service. | |
ConfigurationUpdateSubscriber:: |
public static | function | ||
ConfigurationUpdateSubscriber:: |
public | function | Handles on configuration update event. | |
ConfigurationUpdateSubscriber:: |
public | function | ConfigurationUpdateSubscriber constructor. |