You are here

protected function WebformImageSelectImagesForm::prepareEntity in Webform 8.5

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

Prepares the entity object before the form is built first.

Overrides EntityForm::prepareEntity

File

modules/webform_image_select/src/WebformImageSelectImagesForm.php, line 38

Class

WebformImageSelectImagesForm
Provides a form to set webform image select images.

Namespace

Drupal\webform_image_select

Code

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