You are here

public function EventMeta::getDefaultGroups in RNG - Events and Registrations 3.x

Same name and namespace in other branches
  1. 8.2 src/EventMeta.php \Drupal\rng\EventMeta::getDefaultGroups()
  2. 8 src/EventMeta.php \Drupal\rng\EventMeta::getDefaultGroups()

Get groups that should be added to all new registrations.

Return value

\Drupal\rng\Entity\GroupInterface[] An array of group entities.

Overrides EventMetaInterface::getDefaultGroups

File

src/EventMeta.php, line 280

Class

EventMeta
Meta event wrapper for RNG.

Namespace

Drupal\rng

Code

public function getDefaultGroups() {
  $groups = [];
  foreach ($this
    ->getEvent()->{EventManagerInterface::FIELD_REGISTRATION_GROUPS} as $group) {
    $groups[] = $group->entity;
  }
  return $groups;
}