You are here

class MentionsUpdate in Open Social 8

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

MentionsUpdate handles event 'mentions.update'.

Hierarchy

  • class \Drupal\mentions\EventSubscriber\MentionsUpdate implements \Symfony\Component\EventDispatcher\EventSubscriberInterface

Expanded class hierarchy of MentionsUpdate

File

modules/custom/mentions/src/EventSubscriber/MentionsUpdate.php, line 10

Namespace

Drupal\mentions\EventSubscriber
View source
class MentionsUpdate implements EventSubscriberInterface {

  /**
   * {@inheritdoc}
   */
  public static function getSubscribedEvents() {
    $events = [];
    $events['mentions.update'][] = [
      'onMentionsUpdate',
      0,
    ];
    return $events;
  }

  /**
   * {@inheritdoc}
   */
  public function onMentionsUpdate($event) {
    $config = \Drupal::config('mentions.mentions');
    $config_mentions_events = $config
      ->get('mentions_events');
    $action_id = $config_mentions_events['update'];
    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);
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
MentionsUpdate::getSubscribedEvents public static function Returns an array of event names this subscriber wants to listen to.
MentionsUpdate::onMentionsUpdate public function