src/ProophEventStoreModule/Factory/AbstractRepositoryFactory.php
public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
    {
        $repoConfig = $this->repositoryMap[$requestedName];

        $repoClass = "";
        $repoAggregateTranslator = "";
        $repoStreamStrategy = "";
        $repoAggregateType = "";

        if (is_string($repoConfig)) {
            $repoClass = $repoConfig;
            $repoAggregateTranslator = "prooph.event_store.default_aggregate_translator";
            $repoStreamStrategy = "prooph.event_store.default_stream_strategy";
            $repoAggregateType  = "prooph.event_store." . $requestedName . "aggregate_type";
        } else if (is_array($repoConfig)) {
            if (! isset($repoConfig['repository_class'])) {
                throw ConfigurationException::configurationError("Missing repository_class for alias " . $requestedName);
            }

            if (! isset($repoConfig['aggregate_type'])) {
                throw ConfigurationException::configurationError("Missing aggregate_type for alias " . $requestedName);
            }

            $repoClass = $repoConfig['repository_class'];
            $repoAggregateTranslator = isset($repoConfig['aggregate_translator'])? $repoConfig['aggregate_translator'] : "prooph.event_store.default_aggregate_translator";
            $repoStreamStrategy = isset($repoConfig['stream_strategy'])? $repoConfig['stream_strategy'] : "prooph.event_store.default_stream_strategy";
            $repoAggregateType = $repoConfig['aggregate_type'];
        } else {
            throw ConfigurationException::configurationError("Wrong type provided for repository map of alias " . $requestedName);
        }

        if (! class_exists($repoClass)) {
            throw ConfigurationException::configurationError(sprintf(
                "Repository alias %s points to a non existing class %s",
                $requestedName,
                $repoClass
            ));
        }

        return new $repoClass(
            $serviceLocator->get('prooph.event_store'),
            $serviceLocator->get($repoAggregateTranslator),
            $serviceLocator->get($repoStreamStrategy),
            AggregateType::fromString($repoAggregateType)
        );
    }
public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
    {
        $repoConfig = $this->repositoryMap[$requestedName];

        $repoClass = "";
        $repoAggregateTranslator = "";
        $repoStreamStrategy = "";
        $repoAggregateType = "";

        if (is_string($repoConfig)) {
            $repoClass = $repoConfig;
            $repoAggregateTranslator = "prooph.event_store.default_aggregate_translator";
            $repoStreamStrategy = "prooph.event_store.default_stream_strategy";
            $repoAggregateType  = "prooph.event_store." . $requestedName . "aggregate_type";
        } else if (is_array($repoConfig)) {
            if (! isset($repoConfig['repository_class'])) {
                throw ConfigurationException::configurationError("Missing repository_class for alias " . $requestedName);
            }

            if (! isset($repoConfig['aggregate_type'])) {
                throw ConfigurationException::configurationError("Missing aggregate_type for alias " . $requestedName);
            }

            $repoClass = $repoConfig['repository_class'];
            $repoAggregateTranslator = isset($repoConfig['aggregate_translator'])? $repoConfig['aggregate_translator'] : "prooph.event_store.default_aggregate_translator";
            $repoStreamStrategy = isset($repoConfig['stream_strategy'])? $repoConfig['stream_strategy'] : "prooph.event_store.default_stream_strategy";
            $repoAggregateType = $repoConfig['aggregate_type'];
        } else {
            throw ConfigurationException::configurationError("Wrong type provided for repository map of alias " . $requestedName);
        }

        if (! class_exists($repoClass)) {
            throw ConfigurationException::configurationError(sprintf(
                "Repository alias %s points to a non existing class %s",
                $requestedName,
                $repoClass
            ));
        }

        return new $repoClass(
            $serviceLocator->get('prooph.event_store'),
            $serviceLocator->get($repoAggregateTranslator),
            $serviceLocator->get($repoStreamStrategy),
            AggregateType::fromString($repoAggregateType)
        );
    }
Create service with name

@param ServiceLocatorInterface $serviceLocator
@param $name
@param $requestedName
@throws \Prooph\EventStore\Configuration\Exception\ConfigurationException
@return AggregateRepository