You are here

public function ContentEntityForm::isDefaultFormLangcode in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Entity/ContentEntityForm.php \Drupal\Core\Entity\ContentEntityForm::isDefaultFormLangcode()

Checks whether the current form language matches the entity one.

Parameters

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

Return value

bool Returns TRUE if the entity form language matches the entity one.

Overrides ContentEntityFormInterface::isDefaultFormLangcode

1 call to ContentEntityForm::isDefaultFormLangcode()
ContentEntityForm::updateFormLangcode in core/lib/Drupal/Core/Entity/ContentEntityForm.php
Updates the form language to reflect any change to the entity language.

File

core/lib/Drupal/Core/Entity/ContentEntityForm.php, line 218
Contains \Drupal\Core\Entity\ContentEntityForm.

Class

ContentEntityForm
Entity form variant for content entity types.

Namespace

Drupal\Core\Entity

Code

public function isDefaultFormLangcode(FormStateInterface $form_state) {
  $this
    ->initFormLangcodes($form_state);
  return $form_state
    ->get('langcode') == $form_state
    ->get('entity_default_langcode');
}