You are here

public function AgreementEntity::submitOptionsForm in Agreement 8.2

Same name and namespace in other branches
  1. 3.0.x src/Plugin/views/field/AgreementEntity.php \Drupal\agreement\Plugin\views\field\AgreementEntity::submitOptionsForm()

Performs some cleanup tasks on the options array before saving it.

Overrides FieldPluginBase::submitOptionsForm

File

src/Plugin/views/field/AgreementEntity.php, line 90

Class

AgreementEntity
Provides a field handler for agreement configuration entities.

Namespace

Drupal\agreement\Plugin\views\field

Code

public function submitOptionsForm(&$form, FormStateInterface $form_state) {
  parent::submitOptionsForm($form, $form_state);
  $options =& $form_state
    ->getValue('options');
  $settable_options = [];
  if (!empty($options['display'])) {
    foreach ($options['display'] as $key => $value) {
      if ($value) {
        $settable_options[] = $key;
      }
    }
  }
  $options['display'] = $settable_options;
}