You are here

function _social_path_manager_group_types in Open Social 8.7

Same name and namespace in other branches
  1. 8.9 modules/custom/social_path_manager/social_path_manager.module \_social_path_manager_group_types()
  2. 8.5 modules/custom/social_path_manager/social_path_manager.module \_social_path_manager_group_types()
  3. 8.6 modules/custom/social_path_manager/social_path_manager.module \_social_path_manager_group_types()
  4. 8.8 modules/custom/social_path_manager/social_path_manager.module \_social_path_manager_group_types()
  5. 10.3.x modules/custom/social_path_manager/social_path_manager.module \_social_path_manager_group_types()
  6. 10.0.x modules/custom/social_path_manager/social_path_manager.module \_social_path_manager_group_types()
  7. 10.1.x modules/custom/social_path_manager/social_path_manager.module \_social_path_manager_group_types()
  8. 10.2.x modules/custom/social_path_manager/social_path_manager.module \_social_path_manager_group_types()

Get a full list of group types.

Return value

array List of group types.

1 call to _social_path_manager_group_types()
social_path_manager_form_alter in modules/custom/social_path_manager/social_path_manager.module
Implements hook_form_alter().

File

modules/custom/social_path_manager/social_path_manager.module, line 128
The Social Path Manager module.

Code

function _social_path_manager_group_types() {
  $types =& drupal_static(__FUNCTION__);
  if (!isset($types)) {
    $types = [];

    /** @var \Drupal\group\Entity\GroupType $group_type */
    foreach (GroupType::loadMultiple() as $group_type) {
      $types[] = $group_type
        ->id();
    }
  }

  // Allow other modules to change the group types.
  \Drupal::moduleHandler()
    ->alter('social_path_manager_group_types', $types);
  return $types;
}