You are here

public function DefaultRoleEvent::setRoles in Organic groups 8

Sets multiple default roles.

Parameters

\Drupal\og\Entity\OgRole[] $roles: An array of OgRole entities to set. These should be unsaved entities that don't have the group entity type and bundle IDs set.

Overrides DefaultRoleEventInterface::setRoles

File

src/Event/DefaultRoleEvent.php, line 77

Class

DefaultRoleEvent
Event that is fired when default roles are compiled.

Namespace

Drupal\og\Event

Code

public function setRoles(array $roles) {
  foreach ($roles as $properties) {
    $this
      ->setRole($properties);
  }
}