Documentation

ImportText

Use case for importing/creating texts.

Handles single text creation.

Tags
since
3.0.0

Table of Contents

Properties

$textRepository  : TextRepositoryInterface

Methods

__construct()  : mixed
Constructor.
execute()  : array{message: string, textId: int|null}
Create a new text.
validateTextLength()  : bool
Validate text length (max 65000 bytes for MySQL TEXT column).
removeSoftHyphens()  : string
Remove soft hyphens from text.

Properties

Methods

execute()

Create a new text.

public execute(int $languageId, string $title, string $text[, string $audioUri = '' ][, string $sourceUri = '' ]) : array{message: string, textId: int|null}
Parameters
$languageId : int

Language ID

$title : string

Title

$text : string

Text content

$audioUri : string = ''

Audio URI (optional)

$sourceUri : string = ''

Source URI (optional)

Return values
array{message: string, textId: int|null}

validateTextLength()

Validate text length (max 65000 bytes for MySQL TEXT column).

public validateTextLength(string $text) : bool
Parameters
$text : string

Text to validate

Return values
bool

True if valid, false if too long

removeSoftHyphens()

Remove soft hyphens from text.

private removeSoftHyphens(string $text) : string
Parameters
$text : string

Text to clean

Return values
string

Cleaned text


        
On this page

Search results