public static function ImageStyles::mappingToSequence in Consumer Image Styles 8.3
Same name and namespace in other branches
- 4.x src/Plugin/jsonapi/FieldEnhancer/ImageStyles.php \Drupal\consumer_image_styles\Plugin\jsonapi\FieldEnhancer\ImageStyles::mappingToSequence()
Transforms the mapping into a sequence.
File
- src/
Plugin/ jsonapi/ FieldEnhancer/ ImageStyles.php, line 263
Class
- ImageStyles
- Perform additional manipulations to timestamp fields.
Namespace
Drupal\consumer_image_styles\Plugin\jsonapi\FieldEnhancerCode
public static function mappingToSequence(array &$element, FormStateInterface $form_state) {
$new_value = array_keys(array_filter($form_state
->getValue($element['#parents'])));
$form_state
->setValue($element['#parents'], $new_value);
}