LocalizationRepository

Repository for record localizations

Internal

Table of Contents

Properties

$translationConfigurationProvider  : TranslationConfigurationProvider

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
Returns the current BE user.
getQueryBuilderWithWorkspaceRestriction()  : QueryBuilder
Get a QueryBuilder for the given table with preconfigured restrictions to not retrieve workspace placeholders or deleted records.

Properties

Methods

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
int

getRecordsToCopyDatabaseResult()

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
Result

getAllowedLanguageConstraintsForBackendUser()

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 = ''

getQueryBuilderWithWorkspaceRestriction()

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
Return values
QueryBuilder

        
On this page

Search results