function EventMeta::getDefaultGroups in RNG - Events and Registrations 8
Same name and namespace in other branches
- 8.2 src/EventMeta.php \Drupal\rng\EventMeta::getDefaultGroups()
- 3.x src/EventMeta.php \Drupal\rng\EventMeta::getDefaultGroups()
Get groups that should be added to all new registrations.
Return value
\Drupal\rng\GroupInterface[] An array of group entities.
Overrides EventMetaInterface::getDefaultGroups
File
- src/
EventMeta.php, line 251
Class
- EventMeta
- Meta event wrapper for RNG.
Namespace
Drupal\rngCode
function getDefaultGroups() {
$groups = [];
foreach ($this
->getEvent()->{EventManagerInterface::FIELD_REGISTRATION_GROUPS} as $group) {
$groups[] = $group->entity;
}
return $groups;
}