AppserverIo\Appserver\PersistenceContainer\PersistenceManager::injectEntityManagers PHP Метод

injectEntityManagers() публичный Метод

Injects the storage for the entity manager configurations.
public injectEntityManagers ( AppserverIo\Storage\GenericStackable $entityManagers ) : void
$entityManagers AppserverIo\Storage\GenericStackable The storage for the entity manager configurations
Результат void
    public function injectEntityManagers(GenericStackable $entityManagers)
    {
        $this->entityManagers = $entityManagers;
    }

Usage Example

 /**
  * The main method that creates new instances in a separate context.
  *
  * @param \AppserverIo\Psr\Application\ApplicationInterface         $application          The application instance to register the class loader with
  * @param \AppserverIo\Appserver\Core\Api\Node\ManagerNodeInterface $managerConfiguration The manager configuration
  *
  * @return void
  */
 public static function visit(ApplicationInterface $application, ManagerNodeInterface $managerConfiguration)
 {
     // initialize the stackable for the entity managers
     $entityManagers = new GenericStackable();
     // initialize the persistence manager instance
     $persistenceManager = new PersistenceManager();
     $persistenceManager->injectApplication($application);
     $persistenceManager->injectEntityManagers($entityManagers);
     // attach the instance
     $application->addManager($persistenceManager, $managerConfiguration);
 }
All Usage Examples Of AppserverIo\Appserver\PersistenceContainer\PersistenceManager::injectEntityManagers