LocalizationRepository
Repository for having low-level logic fetching "record translation" dealing with for the TYPO3 Backend!
A few rules for this class:
- It only returns translated records (having l10n_parent / l10n_source > 0)
- It only deals with RawRecord (not other Records) as we are usually interested in the raw values
- It has no dependency on $GLOBALS['BE_USER']
Attributes
- #[Autoconfigure]
- $public: true
Table of Contents
Properties
Methods
- __construct() : mixed
- getPageTranslations() : array<string|int, RawRecord>
- Fetches all existing page translations for a given page.
- getRecordsToCopyDatabaseResult() : Result
- Get records for copy process
- getRecordTranslation() : RawRecord|null
- Fetches the translated version of a record.
- getRecordTranslations() : array<string|int, RawRecord>
- Fetches all translations of a record.
Properties
$recordFactory
protected
RecordFactory
$recordFactory
$tcaSchemaFactory
protected
TcaSchemaFactory
$tcaSchemaFactory
Methods
__construct()
public
__construct(TcaSchemaFactory $tcaSchemaFactory, RecordFactory $recordFactory) : mixed
Parameters
- $tcaSchemaFactory : TcaSchemaFactory
- $recordFactory : RecordFactory
getPageTranslations()
Fetches all existing page translations for a given page.
public
getPageTranslations(int $pageUid[, array<string|int, int> $limitToLanguageIds = [] ][, int $workspaceId = 0 ][, bool $includeDeletedRecords = false ]) : array<string|int, RawRecord>
It automatically applies workspace overlay and filters out DELETE_PLACEHOLDER records.
Parameters
- $pageUid : int
-
The UID of the default language page
- $limitToLanguageIds : array<string|int, int> = []
-
Optional list of language IDs to filter by
- $workspaceId : int = 0
- $includeDeletedRecords : bool = false
Return values
array<string|int, RawRecord> —Array of page translation records indexed by language ID
getRecordsToCopyDatabaseResult()
Get records for copy process
public
getRecordsToCopyDatabaseResult(int $pageId, int $destLanguageId, int $languageId[, int $workspaceId = 0 ]) : Result
Parameters
- $pageId : int
- $destLanguageId : int
- $languageId : int
- $workspaceId : int = 0
Return values
ResultgetRecordTranslation()
Fetches the translated version of a record.
public
getRecordTranslation(string|TcaSchema $tableOrSchema, int|array<string|int, mixed>|RecordInterface $recordOrUid, int|LanguageAspect $language[, int $workspaceId = 0 ][, bool $includeDeletedRecords = false ]) : RawRecord|null
It automatically applies workspace overlay and filters out DELETE_PLACEHOLDER records.
Parameters
- $tableOrSchema : string|TcaSchema
-
The table name or TCA schema
- $recordOrUid : int|array<string|int, mixed>|RecordInterface
-
The record UID, or the full record (array or RecordInterface). When passing the full record, the pid is automatically used for filtering.
- $language : int|LanguageAspect
-
The target language ID or LanguageAspect
- $workspaceId : int = 0
- $includeDeletedRecords : bool = false
Return values
RawRecord|null —The translated record or null if not found
getRecordTranslations()
Fetches all translations of a record.
public
getRecordTranslations(string|TcaSchema $tableOrSchema, int|array<string|int, mixed>|RecordInterface $recordOrUid[, array<string|int, int> $limitToLanguageIds = [] ][, int $workspaceId = 0 ][, bool $includeDeletedRecords = false ]) : array<string|int, RawRecord>
It automatically applies workspace overlay and filters out DELETE_PLACEHOLDER records.
Parameters
- $tableOrSchema : string|TcaSchema
-
The table name or TCA schema
- $recordOrUid : int|array<string|int, mixed>|RecordInterface
-
The record UID, or the full record (array or RecordInterface). When passing the full record, the pid is automatically used for filtering.
- $limitToLanguageIds : array<string|int, int> = []
-
Optional list of language IDs to filter by
- $workspaceId : int = 0
- $includeDeletedRecords : bool = false
Return values
array<string|int, RawRecord> —Array of translated records indexed by language ID