You are here

final public function FlexiformFormEntityBase::saveEntity in Flexiform 8

Save the entity.

If subclasses need to do more as part of saving, they should override ::doSave().

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity to save.

Throws

\Drupal\Core\Entity\EntityStorageException Errors during the entity save.

File

src/FormEntity/FlexiformFormEntityBase.php, line 128

Class

FlexiformFormEntityBase
Provides the base form entity plugin.

Namespace

Drupal\flexiform\FormEntity

Code

public final function saveEntity(EntityInterface $entity) {
  if (!isset($this->configuration['save_on_submit']) || $this->configuration['save_on_submit']) {
    $this
      ->doSave($entity);
  }
}