Documentation

GetTextForEdit

Use case for retrieving text data for editing.

Gets text details for edit forms for both active and archived texts.

Tags
since
3.0.0

Table of Contents

Properties

$textRepository  : TextRepositoryInterface

Methods

__construct()  : mixed
Constructor.
getArchivedTextById()  : array<string|int, mixed>|null
Get archived text by ID.
getLanguageDataForForm()  : array<int, string>
Get language data for form dropdowns (translate URIs).
getTextById()  : array<string|int, mixed>|null
Get active text by ID.
getTextForEdit()  : array<string|int, mixed>|null
Get text for edit form.
getTextsForSelect()  : array<int, array{id: int, title: string, language_id: int}>
Get texts formatted for select dropdown.
textEntityToArray()  : array<string|int, mixed>
Convert Text entity to array for backward compatibility.

Properties

Methods

getArchivedTextById()

Get archived text by ID.

public getArchivedTextById(int $textId) : array<string|int, mixed>|null
Parameters
$textId : int

Archived text ID

Return values
array<string|int, mixed>|null

Archived text data or null if not found

getLanguageDataForForm()

Get language data for form dropdowns (translate URIs).

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

Map of language ID to Google Translate URI

getTextById()

Get active text by ID.

public getTextById(int $textId) : array<string|int, mixed>|null
Parameters
$textId : int

Text ID

Return values
array<string|int, mixed>|null

Text data or null if not found

getTextForEdit()

Get text for edit form.

public getTextForEdit(int $textId) : array<string|int, mixed>|null
Parameters
$textId : int

Text ID

Return values
array<string|int, mixed>|null

Text data for edit form or null if not found

getTextsForSelect()

Get texts formatted for select dropdown.

public getTextsForSelect([int $languageId = 0 ][, int $maxNameLength = 30 ]) : array<int, array{id: int, title: string, language_id: int}>
Parameters
$languageId : int = 0

Language ID (0 for all)

$maxNameLength : int = 30

Maximum title length before truncation

Return values
array<int, array{id: int, title: string, language_id: int}>

textEntityToArray()

Convert Text entity to array for backward compatibility.

private textEntityToArray(Text $text) : array<string|int, mixed>
Parameters
$text : Text

Text entity

Return values
array<string|int, mixed>

Text data as associative array


        
On this page

Search results