You are here

public function FlexiformBuilderFlexiform::getEntityManager in Flexiform 7

Get the entity manager.

Return value

FlexiformFormEntityManagerInterface The entity manager for this form builder.

1 call to FlexiformBuilderFlexiform::getEntityManager()
FlexiformBuilderFlexiform::formSubmit in includes/builder/flexiform.builder.inc
Submit the form.

File

includes/builder/flexiform.builder.inc, line 30
Contains the FlexiformBuilderFlexiform Class

Class

FlexiformBuilderFlexiform
Flexiform Builder Class for the complex flexiforms.

Code

public function getEntityManager(&$state = array()) {
  if (!empty($this->entityManager)) {
    return $this->entityManager;
  }
  if (!empty($state['flexiform_entity_manager'])) {
    $this->entityManager = $state['flexiform_entity_manager'];
    return $this->entityManager;
  }
  $this->entityManager = new FlexiformFormEntityManagerDefault($this->flexiform->entities, $this);
  $this->entityManager
    ->setBaseEntity($this->base_entity);
  $state['flexiform_entity_manager'] = $this->entityManager;
  return $this->entityManager;
}