diff --git a/eZ/Bundle/EzPublishCoreBundle/ApiLoader/RepositoryConfigurationProvider.php b/eZ/Bundle/EzPublishCoreBundle/ApiLoader/RepositoryConfigurationProvider.php index 89903d26f5f..77783b3171e 100644 --- a/eZ/Bundle/EzPublishCoreBundle/ApiLoader/RepositoryConfigurationProvider.php +++ b/eZ/Bundle/EzPublishCoreBundle/ApiLoader/RepositoryConfigurationProvider.php @@ -40,7 +40,7 @@ public function getRepositoryConfig() // Takes configured repository as the reference, if it exists. // If not, the first configured repository is considered instead. $repositoryAlias = $this->configResolver->getParameter('repository'); - $repositoryAlias = $repositoryAlias ?: $this->pullDefaultRepository(); + $repositoryAlias = $repositoryAlias ?: $this->getDefaultRepositoryAlias(); if (empty($repositoryAlias) || !isset($this->repositories[$repositoryAlias])) { throw new InvalidRepositoryException( @@ -51,7 +51,12 @@ public function getRepositoryConfig() return ['alias' => $repositoryAlias] + $this->repositories[$repositoryAlias]; } - public function pullDefaultRepository(): ?string + public function getCurrentRepositoryAlias(): string + { + return $this->getRepositoryConfig()['alias']; + } + + public function getDefaultRepositoryAlias(): ?string { $aliases = array_keys($this->repositories);