You are here

public function PathFileEntityForm::updateStatus in Path File 8

Entity builder updating the node status with the submitted value.

Parameters

string $entity_type_id: The entity type identifier.

\Drupal\path_file\Entity\PathFileEntityInterface $path_file: The path_file_entity updated with the submitted values.

array $form: The complete form array.

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

See also

\Drupal\path_file\Form\PathFileEntityForm::form()

File

src/Form/PathFileEntityForm.php, line 42

Class

PathFileEntityForm
Form controller for Path file entity edit forms.

Namespace

Drupal\path_file\Form

Code

public function updateStatus($entity_type_id, PathFileEntityInterface $path_file, array $form, FormStateInterface $form_state) {
  $element = $form_state
    ->getTriggeringElement();
  if (isset($element['#published_status'])) {
    $path_file
      ->setPublished($element['#published_status']);
  }
}