You are here

public function EventMeta::getDefaultGroups in RNG - Events and Registrations 8.2

Same name and namespace in other branches
  1. 8 src/EventMeta.php \Drupal\rng\EventMeta::getDefaultGroups()
  2. 3.x 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 270

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;
}