Skip to content

Instantly share code, notes, and snippets.

@dpi
Last active August 29, 2015 14:26
Show Gist options
  • 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