You are here

public function MentionsInsert::onMentionsInsert in Open Social 8

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

Event Handler.

File

modules/custom/mentions/src/EventSubscriber/MentionsInsert.php, line 23

Class

MentionsInsert
MentionsInsert handles event 'mentions.insert'.

Namespace

Drupal\mentions\EventSubscriber

Code

public function onMentionsInsert($event) {
  $config = \Drupal::config('mentions.mentions');
  $config_mentions_events = $config
    ->get('mentions_events');
  $action_id = $config_mentions_events['insert'];
  if (empty($action_id)) {
    return;
  }
  $entity_storage = \Drupal::entityManager()
    ->getStorage('action');
  $action = $entity_storage
    ->load($action_id);
  $action_plugin = $action
    ->getPlugin();
  if (!empty($action_id)) {
    $action_plugin
      ->execute(FALSE);
  }
}