You are here

public function View::submitConfigurationForm in Entity Browser 8

Same name in this branch
  1. 8 src/Plugin/EntityBrowser/Widget/View.php \Drupal\entity_browser\Plugin\EntityBrowser\Widget\View::submitConfigurationForm()
  2. 8 src/Plugin/EntityBrowser/SelectionDisplay/View.php \Drupal\entity_browser\Plugin\EntityBrowser\SelectionDisplay\View::submitConfigurationForm()
Same name and namespace in other branches
  1. 8.2 src/Plugin/EntityBrowser/Widget/View.php \Drupal\entity_browser\Plugin\EntityBrowser\Widget\View::submitConfigurationForm()

Implements PluginFormInterface::submitConfigurationForm().

This is the default implementation for the most common cases where the form element names match keys in configuration array. Plugins can override this if they need more complex logic.

Overrides PluginConfigurationFormTrait::submitConfigurationForm

File

src/Plugin/EntityBrowser/Widget/View.php, line 280

Class

View
Uses a view to provide entity listing in a browser's widget.

Namespace

Drupal\entity_browser\Plugin\EntityBrowser\Widget

Code

public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
  $values = $form_state
    ->getValues()['table'][$this
    ->uuid()]['form'];
  $this->configuration['submit_text'] = $values['submit_text'];
  $this->configuration['auto_select'] = $values['auto_select'];
  if (!empty($values['view'])) {
    list($view_id, $display_id) = explode('.', $values['view']);
    $this->configuration['view'] = $view_id;
    $this->configuration['view_display'] = $display_id;
  }
}