class RegistrationSubscriber in RNG - Events and Registrations 3.x
Class RegistrationSubscriber.
Hierarchy
- class \Drupal\rng_easy_email\EventSubscriber\RegistrationSubscriber implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
Expanded class hierarchy of RegistrationSubscriber
1 string reference to 'RegistrationSubscriber'
- rng_easy_email.services.yml in rng_easy_email/
rng_easy_email.services.yml - rng_easy_email/rng_easy_email.services.yml
1 service uses RegistrationSubscriber
File
- rng_easy_email/
src/ EventSubscriber/ RegistrationSubscriber.php, line 15
Namespace
Drupal\rng_easy_email\EventSubscriberView source
class RegistrationSubscriber implements EventSubscriberInterface {
/**
* Drupal\rng\EventManagerInterface definition.
*
* @var \Drupal\rng\EventManagerInterface
*/
protected $rngEventManager;
/**
* Drupal\Core\Entity\EntityTypeManagerInterface definition.
*
* @var \Drupal\Core\Entity\EntityTypeManagerInterface
*/
protected $entityTypeManager;
/**
* Dispatch Service.
*
* @var \Drupal\rng_easy_email\DispatchService
*/
protected $dispatchService;
/**
* Constructs a new RegistrationSubscriber object.
*/
public function __construct(EventManagerInterface $rng_event_manager, EntityTypeManagerInterface $entity_type_manager, DispatchService $dispatchService) {
$this->rngEventManager = $rng_event_manager;
$this->entityTypeManager = $entity_type_manager;
$this->dispatchService = $dispatchService;
}
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents() {
$events['rng.registration.insert'] = [
'RegistrationSend',
];
$events['rng.registration.registration'] = [
'RegistrationSend',
];
return $events;
}
/**
* This method is called when the rng.registration.insert is dispatched.
* This method is called when the rng.registration.registration is dispatched.
*
* @param RegistrationEvent $event
* The dispatched event.
*/
public function RegistrationSend(RegistrationEvent $event) {
$registration = $event
->getRegistration();
if ($registration
->isConfirmed()) {
$this->dispatchService
->sendRegistration('attendee_registered', $registration);
}
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RegistrationSubscriber:: |
protected | property | Dispatch Service. | |
RegistrationSubscriber:: |
protected | property | Drupal\Core\Entity\EntityTypeManagerInterface definition. | |
RegistrationSubscriber:: |
protected | property | Drupal\rng\EventManagerInterface definition. | |
RegistrationSubscriber:: |
public static | function | ||
RegistrationSubscriber:: |
public | function | This method is called when the rng.registration.insert is dispatched. This method is called when the rng.registration.registration is dispatched. | |
RegistrationSubscriber:: |
public | function | Constructs a new RegistrationSubscriber object. |