You are here

public static function ImageStyles::mappingToSequence in Consumer Image Styles 4.x

Same name and namespace in other branches
  1. 8.3 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\FieldEnhancer

Code

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);
}