public function NodeFormController::submit

Updates the node object by processing the submitted values.

This function can be called by a "Next" button of a wizard to update the form state's entity with the current step's values before proceeding to the next step.

Overrides Drupal\Core\Entity\EntityFormController::submit().

Overrides EntityFormController::submit

File

drupal/core/modules/node/lib/Drupal/node/NodeFormController.php, line 321
Definition of Drupal\node\NodeFormController.

Class

NodeFormController
Form controller for the node edit forms.

Namespace

Drupal\node

Code

public function submit(array $form, array &$form_state) {

  // Build the node object from the submitted values.
  $node = parent::submit($form, $form_state);

  // Save as a new revision if requested to do so.
  if (!empty($form_state['values']['revision'])) {
    $node
      ->setNewRevision();
  }
  node_submit($node);
  foreach (module_implements('node_submit') as $module) {
    $function = $module . '_node_submit';
    $function($node, $form, $form_state);
  }
  return $node;
}