LocalizationRepository
Repository for record localizations
Table of Contents
Properties
Methods
- __construct() : mixed
- fetchAvailableLanguages() : array<string|int, mixed>
- Fetch all available languages
- fetchOriginLanguage() : array<string|int, mixed>
- Fetch the language from which the records in a certain language were initially localized
- getLocalizedRecordCount() : int
- Returns number of localized records in given page and language Records which were added to the language directly (not through translation) are not counted.
- getRecordsToCopyDatabaseResult() : Result
- Get records for copy process
- getAllowedLanguageConstraintsForBackendUser() : void
- Builds additional query constraints to exclude hidden languages and limit a backend user to its allowed languages (unless the user is an admin)
- getBackendUser() : BackendUserAuthentication
- getQueryBuilderWithWorkspaceRestriction() : QueryBuilder
- Get a QueryBuilder for the given table with preconfigured restrictions to not retrieve workspace placeholders or deleted records.
Properties
$translationConfigurationProvider
protected
TranslationConfigurationProvider
$translationConfigurationProvider
Methods
__construct()
public
__construct([TranslationConfigurationProvider|null $translationConfigurationProvider = null ]) : mixed
Parameters
- $translationConfigurationProvider : TranslationConfigurationProvider|null = null
fetchAvailableLanguages()
Fetch all available languages
public
fetchAvailableLanguages(int $pageId, int $languageId) : array<string|int, mixed>
Parameters
- $pageId : int
- $languageId : int
Return values
array<string|int, mixed>fetchOriginLanguage()
Fetch the language from which the records in a certain language were initially localized
public
fetchOriginLanguage(int $pageId, int $localizedLanguage) : array<string|int, mixed>
Parameters
- $pageId : int
- $localizedLanguage : int
Return values
array<string|int, mixed>getLocalizedRecordCount()
Returns number of localized records in given page and language Records which were added to the language directly (not through translation) are not counted.
public
getLocalizedRecordCount(int $pageId, int $languageId) : int
Parameters
- $pageId : int
- $languageId : int
Return values
intgetRecordsToCopyDatabaseResult()
Get records for copy process
public
getRecordsToCopyDatabaseResult(int $pageId, int $destLanguageId, int $languageId[, string $fields = '*' ]) : Result
Parameters
- $pageId : int
- $destLanguageId : int
- $languageId : int
- $fields : string = '*'
Return values
ResultgetAllowedLanguageConstraintsForBackendUser()
Builds additional query constraints to exclude hidden languages and limit a backend user to its allowed languages (unless the user is an admin)
protected
getAllowedLanguageConstraintsForBackendUser(int $pageId, QueryBuilder $queryBuilder, BackendUserAuthentication $backendUser[, string $alias = '' ]) : void
Parameters
- $pageId : int
- $queryBuilder : QueryBuilder
- $backendUser : BackendUserAuthentication
- $alias : string = ''
getBackendUser()
protected
getBackendUser() : BackendUserAuthentication
Return values
BackendUserAuthenticationgetQueryBuilderWithWorkspaceRestriction()
Get a QueryBuilder for the given table with preconfigured restrictions to not retrieve workspace placeholders or deleted records.
protected
getQueryBuilderWithWorkspaceRestriction(string $tableName) : QueryBuilder
Parameters
- $tableName : string