protected function WebformEntityAddForm::prepareEntity in Webform 8.5
Same name and namespace in other branches
- 6.x src/WebformEntityAddForm.php \Drupal\webform\WebformEntityAddForm::prepareEntity()
Prepares the entity object before the form is built first.
Overrides EntityForm::prepareEntity
File
- src/
WebformEntityAddForm.php, line 60
Class
- WebformEntityAddForm
- Provides a webform add form.
Namespace
Drupal\webformCode
protected function prepareEntity() {
if ($this->operation === 'duplicate') {
$this
->setEntity($this
->getEntity()
->createDuplicate());
}
parent::prepareEntity();
}