function EntityTestHooks::formNodeFormAlter

Implements hook_form_BASE_FORM_ID_alter().

File

core/modules/system/tests/modules/entity_test/src/Hook/EntityTestHooks.php, line 248

Class

EntityTestHooks
Hook implementations for entity_test.

Namespace

Drupal\entity_test\Hook

Code

public function formNodeFormAlter(&$form, FormStateInterface $form_state, $form_id) : void {
    $langcode = $form_state->getFormObject()
        ->getFormLangcode($form_state);
    \Drupal::state()->set('entity_test.form_langcode', $langcode);
}

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