You are here

public function FlexiformFormEntityLegacy::saveEntity in Flexiform 7

Save the entity upon submission of the form.

Parameters

$entity: The entity object being saved.

Overrides FlexiformFormEntityBase::saveEntity

File

includes/form_entity/legacy.form_entity.inc, line 35
Contains Legacy Form Entity Class to Utilise Old Getters and Setters.

Class

FlexiformFormEntityLegacy
Legacy form entity class.

Code

public function saveEntity($entity) {
  $getter = $this->getter;
  $base_entity = $this->manager
    ->getBaseEntity();
  $entities = $this->manager
    ->getEntitiesRaw();
  if (isset($getter['file']) && file_exists(drupal_get_path('module', $getter['module']) . '/' . $getter['file'])) {
    include_once drupal_get_path('module', $getter['module']) . '/' . $getter['file'];
  }
  $callback = $getter['setter callback'];
  if (function_exists($callback)) {
    $callback($this->manager
      ->getBuilder()
      ->getFlexiform(), $base_entity, $entity, $this->entity_type, $entities, $this->entity_namespace, $getter);
  }
}