PageLanguageInformation

Read onlyYes
FinalYes

Data Transfer Object representing language availability information for a specific page.

Contains both existing translations and potential new translations.

This provides a single source of truth for:

  • Which languages are configured and available
  • Which languages have translations on this page
  • Which languages can be created (permissions)
  • Translation records with workspace overlay applied
  • UI-ready language items for display
Internal

Table of Contents

Properties

$availableLanguages  : array<string|int, mixed>
$canUserCreateTranslations  : bool
$creatableLanguageIds  : array<string|int, mixed>
$existingTranslations  : array<string|int, mixed>
$languageItems  : array<string|int, mixed>
$languageStatuses  : array<string|int, mixed>
$pageId  : int

Methods

__construct()  : mixed
canCreateTranslation()  : bool
Check if a translation can be created for a specific language.
getAllExistingLanguageIds()  : array<string|int, int>
Get all language IDs including default (0) and all translations.
getLanguageStatus()  : LanguageStatus
Get the status of a specific language.
getTranslationRecord()  : array<string|int, mixed>|null
Get the translation record for a specific language.
hasTranslation()  : bool
Check if a translation exists for a specific language.

Properties

$availableLanguages

public array<string|int, mixed> $availableLanguages

$canUserCreateTranslations

public bool $canUserCreateTranslations

$creatableLanguageIds

public array<string|int, mixed> $creatableLanguageIds

$existingTranslations

public array<string|int, mixed> $existingTranslations

$languageItems

public array<string|int, mixed> $languageItems

$languageStatuses

public array<string|int, mixed> $languageStatuses

Methods

__construct()

public __construct(int $pageId, array<string|int, SiteLanguage$availableLanguages, array<int, LanguageStatus$languageStatuses, array<int, array<string|int, mixed>> $existingTranslations, array<string|int, int> $creatableLanguageIds, bool $canUserCreateTranslations, array<string|int, LanguageItem$languageItems) : mixed
Parameters
$pageId : int

Page ID this information belongs to

$availableLanguages : array<string|int, SiteLanguage>

All available languages

$languageStatuses : array<int, LanguageStatus>

Status for each language (existing/creatable/unavailable)

$existingTranslations : array<int, array<string|int, mixed>>

Raw page translation records, keyed by language ID

$creatableLanguageIds : array<string|int, int>

IDs of languages that can be created

$canUserCreateTranslations : bool

Whether user has permission to create translations

$languageItems : array<string|int, LanguageItem>

UI-ready language items

canCreateTranslation()

Check if a translation can be created for a specific language.

public canCreateTranslation(int $languageId) : bool
Parameters
$languageId : int
Return values
bool

getAllExistingLanguageIds()

Get all language IDs including default (0) and all translations.

public getAllExistingLanguageIds() : array<string|int, int>
Return values
array<string|int, int>

getTranslationRecord()

Get the translation record for a specific language.

public getTranslationRecord(int $languageId) : array<string|int, mixed>|null
Parameters
$languageId : int
Return values
array<string|int, mixed>|null

Translation record or null if not found

hasTranslation()

Check if a translation exists for a specific language.

public hasTranslation(int $languageId) : bool
Parameters
$languageId : int
Return values
bool

        
On this page

Search results