You are here

protected function WebformOptionsCustomForm::prepareEntity in Webform 8.5

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

Prepares the entity object before the form is built first.

Overrides EntityForm::prepareEntity

File

modules/webform_options_custom/src/WebformOptionsCustomForm.php, line 48

Class

WebformOptionsCustomForm
Provides a form to set webform options custom.

Namespace

Drupal\webform_options_custom

Code

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