You are here

protected function WebformOptionsForm::prepareEntity in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/WebformOptionsForm.php \Drupal\webform\WebformOptionsForm::prepareEntity()

Prepares the entity object before the form is built first.

Overrides EntityForm::prepareEntity

File

src/WebformOptionsForm.php, line 39

Class

WebformOptionsForm
Provides a form to set options.

Namespace

Drupal\webform

Code

protected function prepareEntity() {
  if ($this->operation === 'duplicate') {
    $this
      ->setEntity($this
      ->getEntity()
      ->createDuplicate());
  }
  parent::prepareEntity();
}