protected function SocialGroupHero::cropToStyle in Open Social 10.0.x
Same name and namespace in other branches
- 8.9 modules/social_features/social_group/src/SocialGroupHero.php \Drupal\social_group\SocialGroupHero::cropToStyle()
- 8.5 modules/social_features/social_group/src/SocialGroupHero.php \Drupal\social_group\SocialGroupHero::cropToStyle()
- 8.6 modules/social_features/social_group/src/SocialGroupHero.php \Drupal\social_group\SocialGroupHero::cropToStyle()
- 8.7 modules/social_features/social_group/src/SocialGroupHero.php \Drupal\social_group\SocialGroupHero::cropToStyle()
- 8.8 modules/social_features/social_group/src/SocialGroupHero.php \Drupal\social_group\SocialGroupHero::cropToStyle()
- 10.3.x modules/social_features/social_group/src/SocialGroupHero.php \Drupal\social_group\SocialGroupHero::cropToStyle()
- 10.1.x modules/social_features/social_group/src/SocialGroupHero.php \Drupal\social_group\SocialGroupHero::cropToStyle()
- 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_groupCode
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';
}