You are here

public function DefaultRoleEventInterface::addRole in Organic groups 8

Adds a default role.

Parameters

\Drupal\og\Entity\OgRole $role: The OgRole entity to add. This should be an unsaved entity that doesn't have the group entity type and bundle IDs set.

Throws

\InvalidArgumentException Thrown when the role that is added already exists.

1 method overrides DefaultRoleEventInterface::addRole()
DefaultRoleEvent::addRole in src/Event/DefaultRoleEvent.php
Adds a default role.

File

src/Event/DefaultRoleEventInterface.php, line 54

Class

DefaultRoleEventInterface
Interface for DefaultRoleEvent classes.

Namespace

Drupal\og\Event

Code

public function addRole(OgRole $role);