AppserverIo\Appserver\PersistenceContainer\PersistenceManager::lookup PHP Method

lookup() public method

If the passed lookup name is an entity manager the instance will be returned.
public lookup ( string $lookupName ) : object
$lookupName string The name of the requested entity manager
return object The requested entity manager instance
    public function lookup($lookupName)
    {
        // query whether the entity manager has been registered or not
        if (isset($this->entityManagers[$lookupName])) {
            // load the entity manager configuration
            $persistenceUnitNode = $this->entityManagers[$lookupName];
            // load the factory class from the configuration
            $factoryClass = $persistenceUnitNode->getFactory();
            // create a new entity manager instance from the configuration
            return $factoryClass::factory($this->getApplication(), $persistenceUnitNode);
        }
        // throw an exception if the requested entity manager has not been registered
        throw new EntityManagerLookupException(sprintf('Entity Manager with lookup name %s has not been registered in application %s', $lookupName, $this->getApplication()->getName()));
    }