Documentation

TextCreationAdapter implements TextCreationInterface

Adapter implementing TextCreationInterface.

Provides text creation functionality for the Feed module by using existing LWT infrastructure (TextParsing, QueryBuilder, etc.).

Tags
since
3.0.0

Table of Contents

Interfaces

TextCreationInterface
Interface for creating texts from feed articles.

Methods

archiveOldTexts()  : array{archived: int, sentences: int, textitems: int}
Archive old texts to maintain max texts limit.
countTextsWithTag()  : int
Count texts with the given tag.
createText()  : int
Create a text from extracted article content.
sourceUriExists()  : bool
Check if a text with the given source URI already exists.

Methods

archiveOldTexts()

Archive old texts to maintain max texts limit.

public archiveOldTexts(string $tagName, int $maxTexts) : array{archived: int, sentences: int, textitems: int}
Parameters
$tagName : string

Tag name to filter by

$maxTexts : int

Maximum number of texts to keep

Return values
array{archived: int, sentences: int, textitems: int}

countTextsWithTag()

Count texts with the given tag.

public countTextsWithTag(string $tagName) : int
Parameters
$tagName : string

Tag name

Return values
int

createText()

Create a text from extracted article content.

public createText(int $languageId, string $title, string $text, string $audioUri, string $sourceUri, string $tagName) : int
Parameters
$languageId : int

Language ID for the text

$title : string

Text title

$text : string

Text content

$audioUri : string

Audio URI (optional, empty string if none)

$sourceUri : string

Source URI (the article link)

$tagName : string

Tag name to apply to the text

Return values
int

The newly created text ID

sourceUriExists()

Check if a text with the given source URI already exists.

public sourceUriExists(string $sourceUri) : bool
Parameters
$sourceUri : string

Source URI to check

Return values
bool

True if a text or archived text exists with this source URI


        
On this page

Search results