protected function OgRole::groupTypeManager in Organic groups 8
Gets the group manager.
Return value
\Drupal\og\GroupTypeManagerInterface The group manager.
File
- src/
Entity/ OgRole.php, line 302
Class
- OgRole
- Defines the OG user role entity class.
Namespace
Drupal\og\EntityCode
protected function groupTypeManager() {
// Returning the group manager by calling the global factory method might
// seem less than ideal, but Entity classes are not designed to work with
// proper dependency injection. The ::create() method only accepts a $values
// array, which is not compatible with ContainerInjectionInterface.
// See for example Entity::uuidGenerator() in the base Entity class, it
// also uses this pattern.
return \Drupal::service('og.group_type_manager');
}