You are here

public static function SocialGroupHelperService::getDefaultGroupVisibility in Open Social 8.9

Same name and namespace in other branches
  1. 8.4 modules/social_features/social_group/src/SocialGroupHelperService.php \Drupal\social_group\SocialGroupHelperService::getDefaultGroupVisibility()
  2. 8.5 modules/social_features/social_group/src/SocialGroupHelperService.php \Drupal\social_group\SocialGroupHelperService::getDefaultGroupVisibility()
  3. 8.6 modules/social_features/social_group/src/SocialGroupHelperService.php \Drupal\social_group\SocialGroupHelperService::getDefaultGroupVisibility()
  4. 8.7 modules/social_features/social_group/src/SocialGroupHelperService.php \Drupal\social_group\SocialGroupHelperService::getDefaultGroupVisibility()
  5. 8.8 modules/social_features/social_group/src/SocialGroupHelperService.php \Drupal\social_group\SocialGroupHelperService::getDefaultGroupVisibility()
  6. 10.3.x modules/social_features/social_group/src/SocialGroupHelperService.php \Drupal\social_group\SocialGroupHelperService::getDefaultGroupVisibility()
  7. 10.0.x modules/social_features/social_group/src/SocialGroupHelperService.php \Drupal\social_group\SocialGroupHelperService::getDefaultGroupVisibility()
  8. 10.1.x modules/social_features/social_group/src/SocialGroupHelperService.php \Drupal\social_group\SocialGroupHelperService::getDefaultGroupVisibility()
  9. 10.2.x modules/social_features/social_group/src/SocialGroupHelperService.php \Drupal\social_group\SocialGroupHelperService::getDefaultGroupVisibility()

Returns the default visibility.

Parameters

string $type: The Group Type.

Return value

string|null The default visibility.

1 call to SocialGroupHelperService::getDefaultGroupVisibility()
GroupContentVisibilityUpdate::updateVisibility in modules/social_features/social_group/src/GroupContentVisibilityUpdate.php
Update visibility for all Group Content based on a new group type.

File

modules/social_features/social_group/src/SocialGroupHelperService.php, line 120

Class

SocialGroupHelperService
Class SocialGroupHelperService.

Namespace

Drupal\social_group

Code

public static function getDefaultGroupVisibility($type) {
  $visibility =& drupal_static(__FUNCTION__ . $type);
  if (empty($visibility)) {
    switch ($type) {
      case 'closed_group':
        $visibility = 'group';
        break;
      case 'open_group':
        $visibility = 'community';
        break;
      case 'public_group':
        $visibility = 'public';
        break;
      default:
        $visibility = NULL;
    }
    \Drupal::moduleHandler()
      ->alter('social_group_default_visibility', $visibility, $type);
  }
  return $visibility;
}