You are here

protected function WebformSubmissionDuplicateForm::prepareEntity in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/WebformSubmissionDuplicateForm.php \Drupal\webform\WebformSubmissionDuplicateForm::prepareEntity()

Prepares the entity object before the form is built first.

Overrides ContentEntityForm::prepareEntity

File

src/WebformSubmissionDuplicateForm.php, line 16

Class

WebformSubmissionDuplicateForm
Provides a webform to duplicate existing submissions.

Namespace

Drupal\webform

Code

protected function prepareEntity() {
  $this
    ->setEntity($this
    ->getEntity()
    ->createDuplicate());
  parent::prepareEntity();
}