function WorkspacesHooks::formAlter

Implements hook_form_alter().

File

core/modules/workspaces/src/Hook/WorkspacesHooks.php, line 80

Class

WorkspacesHooks
Hook implementations for workspaces.

Namespace

Drupal\workspaces\Hook

Code

public function formAlter(&$form, FormStateInterface $form_state, $form_id) : void {
    if ($form_state->getFormObject() instanceof EntityFormInterface) {
        \Drupal::service('class_resolver')->getInstanceFromDefinition(EntityOperations::class)
            ->entityFormAlter($form, $form_state, $form_id);
    }
    \Drupal::service('class_resolver')->getInstanceFromDefinition(FormOperations::class)
        ->formAlter($form, $form_state, $form_id);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.