You are here

class TempstoreAwareFlexiformFormEntityManager in Flexiform 8

Provides a tempstore aware form entity manager.

Hierarchy

Expanded class hierarchy of TempstoreAwareFlexiformFormEntityManager

File

contrib/wizard/src/FormEntity/TempstoreAwareFormEntityManager.php, line 10

Namespace

Drupal\flexiform_wizard\FormEntity
View source
class TempstoreAwareFlexiformFormEntityManager extends FlexiformFormEntityManager {

  /**
   * Tempstore Factory for keeping track of entities.
   *
   * @var \Drupal\user\SharedTempStore|\Drupal\user\PrivateTempStore
   */
  protected $tempstore;

  /**
   * Set the tempstore.
   *
   * @param \Drupal\user\PrivateTempStore|\Drupal\user\SharedTempStore $tempstore
   *   Either Drupal\user\PrivateTempStore or Drupal\user\SharedTempStore.
   */
  protected function setTempstore($tempstore) {
    $this->tempstore = $tempstore;
  }

  /**
   * Get the tempstore.
   *
   * @return \Drupal\user\PrivateTempStore|\Drupal\user\SharedTempStore
   *   The tempstore.
   */
  protected function getTempstore() {
    return $this->tempstore;
  }

  /**
   * {@inheritdoc}
   */
  protected function initFormEntities(array $provided = []) {
    $stored_entities = $this->tempstore
      ->get('form_entities');
    $provided = $stored_entities + $provided;
    parent::initFormEntities($provided);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DependencySerializationTrait::$_entityStorages protected property An array of entity type IDs keyed by the property name of their storages.
DependencySerializationTrait::$_serviceIds protected property An array of service IDs keyed by property name used for serialization.
DependencySerializationTrait::__sleep public function 1
DependencySerializationTrait::__wakeup public function 2
FlexiformFormEntityManager::$contexts protected property An array of contexts.
FlexiformFormEntityManager::$deferredSaves protected property An array of deferred entity saves to perform.
FlexiformFormEntityManager::$formDisplay protected property The form display config entity.
FlexiformFormEntityManager::clearDeferredSave public function Clear a deferred save requirement.
FlexiformFormEntityManager::deferredSave public function Track that we need to do a deferred save of an entity.
FlexiformFormEntityManager::getContext public function
FlexiformFormEntityManager::getContextDefinitions public function Get the context definitions from the form entity plugins.
FlexiformFormEntityManager::getContexts public function Get the actual contexts
FlexiformFormEntityManager::getEntity public function Get the entity at a given namespace.
FlexiformFormEntityManager::getFormEntities public function Get the form entities.
FlexiformFormEntityManager::getFormEntity public function Get the form entity at a given namespace.
FlexiformFormEntityManager::getPluginManager protected function Get the flexiform form entity plugin manager.
FlexiformFormEntityManager::saveFormEntities public function Save the form entities.
FlexiformFormEntityManager::__construct public function Construct a new FlexiformFormEntityManager.
StringTranslationTrait::$stringTranslation protected property The string translation service. 1
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.
TempstoreAwareFlexiformFormEntityManager::$tempstore protected property Tempstore Factory for keeping track of entities.
TempstoreAwareFlexiformFormEntityManager::getTempstore protected function Get the tempstore.
TempstoreAwareFlexiformFormEntityManager::initFormEntities protected function Initialize form entities. Overrides FlexiformFormEntityManager::initFormEntities
TempstoreAwareFlexiformFormEntityManager::setTempstore protected function Set the tempstore.