You are here

public function WorkspaceUnarchiveForm::validateForm in Workspace 8

Form validation 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 FormBase::validateForm

File

src/Form/WorkspaceUnarchiveForm.php, line 82

Class

WorkspaceUnarchiveForm
Handle workspace unarchive on administrative pages.

Namespace

Drupal\workspace\Form

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  if ($this->workspace
    ->isPublished()) {
    $form_state
      ->setErrorByName('', 'This workspace is not archived.');
  }
}