public function NodeFormController::unpublish

Form submission handler for the 'unpublish' action.

Parameters

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

$form_state: A reference to a keyed array containing the current state of the form.

File

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

Class

NodeFormController
Form controller for the node edit forms.

Namespace

Drupal\node

Code

public function unpublish(array $form, array &$form_state) {
  $node = $this->entity;
  $node->status = 0;
  return $node;
}