You are here

protected function YamlFormEntityForm::prepareEntity in YAML Form 8

Prepares the entity object before the form is built first.

Overrides EntityForm::prepareEntity

File

src/YamlFormEntityForm.php, line 81

Class

YamlFormEntityForm
Base for controller for form.

Namespace

Drupal\yamlform

Code

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