Same name and namespace in other branches
- 3.0.x src/Plugin/Field/FieldFormatter/ColorFieldFormatterSwatch.php \Drupal\color_field\Plugin\Field\FieldFormatter\ColorFieldFormatterSwatch::getShape()
This is used to get the shape.
Paramètres
string|null $shape: The specific shape name to get.
Return value
array|string An array of shape ids/names or translated name of the specified shape.
2 calls to ColorFieldFormatterSwatch::getShape()
- ColorFieldFormatterSwatch::settingsForm dans src/
Plugin/ Field/ FieldFormatter/ ColorFieldFormatterSwatch.php - ColorFieldFormatterSwatch::settingsSummary dans src/
Plugin/ Field/ FieldFormatter/ ColorFieldFormatterSwatch.php
Fichier
-
src/
Plugin/ Field/ FieldFormatter/ ColorFieldFormatterSwatch.php, line 96
Classe
- ColorFieldFormatterSwatch
- Plugin implementation of the color_field swatch formatter.
Namespace
Drupal\color_field\Plugin\Field\FieldFormatterCode
protected function getShape($shape = NULL) {
$formats = [];
$formats['square'] = $this->t('Square');
$formats['circle'] = $this->t('Circle');
$formats['parallelogram'] = $this->t('Parallelogram');
$formats['triangle'] = $this->t('Triangle');
if ($shape) {
return $formats[$shape];
}
return $formats;
}