You are here

protected function EntityExportCsvSettings::massageValues in Entity Export CSV 8

Massage the values.

Parameters

array $values: The values.

1 call to EntityExportCsvSettings::massageValues()
EntityExportCsvSettings::submitForm in src/Form/EntityExportCsvSettings.php
Form submission handler.

File

src/Form/EntityExportCsvSettings.php, line 228

Class

EntityExportCsvSettings
Define entity export csv settings form.

Namespace

Drupal\entity_export_csv\Form

Code

protected function massageValues(array &$values) {
  foreach ($values['entity_types'] as $entity_type_id => $entity_type_value) {
    if (!empty($entity_type_value['limit_per_bundle'])) {
      $limit_per_bundle = $entity_type_value['limit_per_bundle'];
      $values['entity_types'][$entity_type_id]['limit_per_bundle'] = array_filter($limit_per_bundle);
    }
    if (!empty($entity_type_value['bundles'])) {
      foreach ($entity_type_value['bundles'] as $bundle => $bundle_value) {
        $wrapper = $bundle_value['wrapper'];
        unset($values['entity_types'][$entity_type_id]['bundles'][$bundle]['wrapper']);
        $values['entity_types'][$entity_type_id]['bundles'][$bundle] = array_filter($wrapper);
      }
    }
  }
}