You are here

public function RelationGenerate::submitForm in Relation 8.2

Same name and namespace in other branches
  1. 8 relation_devel/src/Form/RelationGenerate.php \Drupal\relation_devel\Form\RelationGenerate::submitForm()

Form submission handler.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Overrides FormInterface::submitForm

File

relation_devel/src/Form/RelationGenerate.php, line 76
Contains \Drupal\relation_devel\Form\RelationGenerate.

Class

RelationGenerate
Provides a form for generating dummy relations.

Namespace

Drupal\relation_devel\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $number = $form_state['values']['relation_number'];
  $relation_types = $form_state['values']['relation_types'];
  $kill = $form_state['values']['relation_kill'];
  include_once drupal_get_path('module', 'relation') . '/relation.drush.inc';
  $relation_types = array_keys(array_filter($relation_types));
  $relation_types = empty($relation_types) ? NULL : $relation_types;
  $relation_ids = relation_generate_relations($number, $relation_types, $kill);
}