From 61fab10ee3b98ee77d9cfd6ca65008731fad0a32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20R?= Date: Wed, 27 Jun 2018 17:52:07 +0200 Subject: [PATCH] EZP-27429: Optional SiteAccessAware Repository layer (#2064) * [REST] Forward BC to make sure all languages are loaded * [Tests] Add testing of the SiteAccessAware Repository * New SiteAccessAware Repository layer Based on work done in https://github.com/ezsystems/ezpublish-kernel/pull/1966 * Fix errror about missing class (loading order?) * CS * Add missing coreLoader in EzPublishCoreExtension * Update PR * Change ContentViewBuilder, Param Converters and relevant Twig helpers to use SiteAccessAware Repo * fix review comments * Remove RoleService which atm has no logic (re-add when we add prioritized languages there) * Move LanguageResolver into own namespace and fix phpdoc to use FQCN * Enable missing test coverage * Update language args phpdoc on UrlAliasService * [yml] Fixed wrong usage of inner_repository in siteaccessaware.repository --- Repository/Tests/SetupFactory/Legacy.php | 4 ++++ Repository/Values/Content/Language.php | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/Repository/Tests/SetupFactory/Legacy.php b/Repository/Tests/SetupFactory/Legacy.php index f0d6e225c..077596525 100644 --- a/Repository/Tests/SetupFactory/Legacy.php +++ b/Repository/Tests/SetupFactory/Legacy.php @@ -81,6 +81,10 @@ public function __construct() self::$dsn = 'sqlite://:memory:'; } + if ($repositoryReference = getenv('REPOSITORY_SERVICE_ID')) { + $this->repositoryReference = $repositoryReference; + } + self::$db = preg_replace('(^([a-z]+).*)', '\\1', self::$dsn); if (!isset(self::$ioRootDir)) { diff --git a/Repository/Values/Content/Language.php b/Repository/Values/Content/Language.php index edd99f82d..e277eb75a 100644 --- a/Repository/Values/Content/Language.php +++ b/Repository/Values/Content/Language.php @@ -20,6 +20,11 @@ */ class Language extends ValueObject { + /** + * Constant for use in API's to specify that you want to load all languages. + */ + const ALL = []; + /** * The language id (auto generated). *