You are here

public function MentionsDelete::onMentionsDelete in Open Social 10.0.x

Same name and namespace in other branches
  1. 8.9 modules/custom/mentions/src/EventSubscriber/MentionsDelete.php \Drupal\mentions\EventSubscriber\MentionsDelete::onMentionsDelete()
  2. 8 modules/custom/mentions/src/EventSubscriber/MentionsDelete.php \Drupal\mentions\EventSubscriber\MentionsDelete::onMentionsDelete()
  3. 8.2 modules/custom/mentions/src/EventSubscriber/MentionsDelete.php \Drupal\mentions\EventSubscriber\MentionsDelete::onMentionsDelete()
  4. 8.3 modules/custom/mentions/src/EventSubscriber/MentionsDelete.php \Drupal\mentions\EventSubscriber\MentionsDelete::onMentionsDelete()
  5. 8.4 modules/custom/mentions/src/EventSubscriber/MentionsDelete.php \Drupal\mentions\EventSubscriber\MentionsDelete::onMentionsDelete()
  6. 8.5 modules/custom/mentions/src/EventSubscriber/MentionsDelete.php \Drupal\mentions\EventSubscriber\MentionsDelete::onMentionsDelete()
  7. 8.6 modules/custom/mentions/src/EventSubscriber/MentionsDelete.php \Drupal\mentions\EventSubscriber\MentionsDelete::onMentionsDelete()
  8. 8.7 modules/custom/mentions/src/EventSubscriber/MentionsDelete.php \Drupal\mentions\EventSubscriber\MentionsDelete::onMentionsDelete()
  9. 8.8 modules/custom/mentions/src/EventSubscriber/MentionsDelete.php \Drupal\mentions\EventSubscriber\MentionsDelete::onMentionsDelete()
  10. 10.3.x modules/custom/mentions/src/EventSubscriber/MentionsDelete.php \Drupal\mentions\EventSubscriber\MentionsDelete::onMentionsDelete()
  11. 10.1.x modules/custom/mentions/src/EventSubscriber/MentionsDelete.php \Drupal\mentions\EventSubscriber\MentionsDelete::onMentionsDelete()
  12. 10.2.x modules/custom/mentions/src/EventSubscriber/MentionsDelete.php \Drupal\mentions\EventSubscriber\MentionsDelete::onMentionsDelete()

Event handler.

File

modules/custom/mentions/src/EventSubscriber/MentionsDelete.php, line 53

Class

MentionsDelete
MentionsDelete handles event 'mentions.delete'.

Namespace

Drupal\mentions\EventSubscriber

Code

public function onMentionsDelete($event) {
  $config = $this->configFactory
    ->get('mentions.settings');
  $config_mentions_events = $config
    ->get('mentions_events');
  $action_id = $config_mentions_events['delete'];
  if (empty($action_id)) {
    return;
  }
  $entity_storage = $this->entityTypeManager
    ->getStorage('action');
  $action = $entity_storage
    ->load($action_id);
  if ($action === NULL) {
    return;
  }
  $action_plugin = $action
    ->getPlugin();
  if (!empty($action_plugin)) {
    $action_plugin
      ->execute(FALSE);
  }
}