public static function WebformRevisionsController::entityBuilder in Config Entity Revisions 8.2
Updates the form language to reflect any change to the entity language.
There are use cases for modules to act both before and after form language being updated, thus the update is performed through an entity builder callback, which allows to support both cases.
Parameters
string $entity_type_id: The entity type identifier.
\Drupal\webform\Entity\WebformSubmission $entity: The 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\Core\Entity\ContentEntityForm::form()
File
- modules/
webform_revisions/ src/ Controller/ WebformRevisionsController.php, line 73
Class
- WebformRevisionsController
- Controller to make library functions available to various consumers.
Namespace
Drupal\webform_revisions\ControllerCode
public static function entityBuilder($entity_type_id, WebformSubmission $entity, array $form, FormStateInterface $form_state) {
/* @var $webform \Drupal\webform_revisions\Entity\WebformRevision */
$webform = $entity
->getWebform();
$entity
->set('webform_revision', $webform
->getRevisionID());
}