Instantiates a view object from form values.
Drupal\views_ui\ViewUI The instantiated view UI object.
protected function instantiateView($form, &$form_state) {
// Build the basic view properties and create the view.
$values = array(
'id' => $form_state['values']['id'],
'label' => $form_state['values']['label'],
'description' => $form_state['values']['description'],
'base_table' => $this->base_table,
'langcode' => language_default()->langcode,
);
$view = entity_create('view', $values);
// Build all display options for this view.
$display_options = $this
->buildDisplayOptions($form, $form_state);
// Allow the fully built options to be altered. This happens before adding
// the options to the view, so that once they are eventually added we will
// be able to get all the overrides correct.
$this
->alterDisplayOptions($display_options, $form, $form_state);
$this
->addDisplays($view, $display_options, $form, $form_state);
return new ViewUI($view);
}