You are here

public function FlexiformFormEntityManagerDefault::saveEntities in Flexiform 7

Save Entities.

File

includes/flexiform.form_entity_manager.inc, line 327
Contains the default entity manager for flexiforms.

Class

FlexiformFormEntityManagerDefault
Class that manages entities in a flexiform.

Code

public function saveEntities() {
  foreach ($this->entitySettings as $namespace => $info) {

    // Allow forms to skip saving particular entities.
    if (!empty($this->skip_save[$namespace])) {
      continue;
    }
    if (($handler = $this
      ->getEntityHandler($namespace)) && ($entity = $this
      ->getEntity($namespace))) {
      $this
        ->executeCallbacks('preSave', $namespace);
      $handler
        ->saveEntity($entity);
      $this
        ->executeCallbacks('postSave', $namespace);
    }
  }

  // Reset the skip entities.
  $this->skip_save = array();
}