public function CustomBlockFormController::submit

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

Updates the custom block 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 EntityFormController::submit

File

drupal/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php, line 147
Contains \Drupal\custom_block\CustomBlockFormController.

Class

CustomBlockFormController
Form controller for the custom block edit forms.

Namespace

Drupal\custom_block

Code

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

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

  // Save as a new revision if requested to do so.
  if (!empty($form_state['values']['revision'])) {
    $block
      ->setNewRevision();
  }
  return $block;
}