You are here

protected function SocialGroupHero::cropToStyle in Open Social 10.1.x

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

Function that converts crop type to image style.

Parameters

string $cropType: The croptype.

Return value

string The associated image style.

2 calls to SocialGroupHero::cropToStyle()
SocialGroupHero::getGroupHeroImageStyle in modules/social_features/social_group/src/SocialGroupHero.php
Function that determines the group hero croptype.
SocialGroupHero::isSmall in modules/social_features/social_group/src/SocialGroupHero.php
Small or not.

File

modules/social_features/social_group/src/SocialGroupHero.php, line 76

Class

SocialGroupHero
Class SocialGroupHero.

Namespace

Drupal\social_group

Code

protected function cropToStyle($cropType) : string {
  $values = [
    'hero' => 'social_xx_large',
    'hero_small' => 'social_hero_small',
  ];
  switch ($cropType) {
    case 'hero_small':
      $this->isSmall = TRUE;
    default:
  }
  return $values[$cropType] ?? 'social_xx_large';
}