Skip to content

Instantly share code, notes, and snippets.

@dpi
Last active August 29, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dpi/9c9804735b0e31425679 to your computer and use it in GitHub Desktop.
Save dpi/9c9804735b0e31425679 to your computer and use it in GitHub Desktop.
Registrants for an event via API (https://github.com/dpi/rng)
$event = entity_load( your event entity here )
$event_manager = \Drupal::service('rng.event_manager');
$event_meta = $event_manager->getMeta($event);
foreach ($event_meta->getRegistrations() as $registration) {
foreach ($registration->getRegistrants() as $registrant) {
$registrant->label();
$registrant->id();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment