MentionsDelete.php in Open Social 8
Same filename and directory in other branches
- 8.9 modules/custom/mentions/src/EventSubscriber/MentionsDelete.php
- 8.2 modules/custom/mentions/src/EventSubscriber/MentionsDelete.php
- 8.3 modules/custom/mentions/src/EventSubscriber/MentionsDelete.php
- 8.4 modules/custom/mentions/src/EventSubscriber/MentionsDelete.php
- 8.5 modules/custom/mentions/src/EventSubscriber/MentionsDelete.php
- 8.6 modules/custom/mentions/src/EventSubscriber/MentionsDelete.php
- 8.7 modules/custom/mentions/src/EventSubscriber/MentionsDelete.php
- 8.8 modules/custom/mentions/src/EventSubscriber/MentionsDelete.php
- 10.3.x modules/custom/mentions/src/EventSubscriber/MentionsDelete.php
- 10.0.x modules/custom/mentions/src/EventSubscriber/MentionsDelete.php
- 10.1.x modules/custom/mentions/src/EventSubscriber/MentionsDelete.php
- 10.2.x modules/custom/mentions/src/EventSubscriber/MentionsDelete.php
Namespace
Drupal\mentions\EventSubscriberFile
modules/custom/mentions/src/EventSubscriber/MentionsDelete.phpView source
<?php
namespace Drupal\mentions\EventSubscriber;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
/**
* MentionsDelete handles event 'mentions.delete'.
*/
class MentionsDelete implements EventSubscriberInterface {
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents() {
$events = [];
$events['mentions.delete'][] = [
'onMentionsDelete',
0,
];
return $events;
}
/**
* Event handler.
*/
public function onMentionsDelete($event) {
$config = \Drupal::config('mentions.mentions');
$config_mentions_events = $config
->get('mentions_events');
$action_id = $config_mentions_events['delete'];
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);
}
}
}
Classes
Name | Description |
---|---|
MentionsDelete | MentionsDelete handles event 'mentions.delete'. |