Documentation

CreateTermFromHover

Use case for creating a term from the text reading hover action.

When a user clicks on a word status in the reading view hover menu, this use case creates the term with the specified status.

Tags
since
3.0.0

Table of Contents

Properties

$vocabularyFacade  : VocabularyFacade

Methods

__construct()  : mixed
Constructor.
execute()  : array{wid: int, word: string, wordRaw: string, translation: string, status: int, hex: string}
Execute the use case.
shouldSetNoCacheHeaders()  : bool
Check if this is a new word (status 1) that should set no-cache headers.

Properties

Methods

execute()

Execute the use case.

public execute(int $textId, string $wordText, int $status[, string $sourceLang = '' ][, string $targetLang = '' ]) : array{wid: int, word: string, wordRaw: string, translation: string, status: int, hex: string}
Parameters
$textId : int

Text ID

$wordText : string

Word text to create

$status : int

Word status (1-5)

$sourceLang : string = ''

Source language code (for translation)

$targetLang : string = ''

Target language code (for translation)

Return values
array{wid: int, word: string, wordRaw: string, translation: string, status: int, hex: string}

shouldSetNoCacheHeaders()

Check if this is a new word (status 1) that should set no-cache headers.

public shouldSetNoCacheHeaders(int $status) : bool
Parameters
$status : int

Word status

Return values
bool

True if no-cache headers should be set


        
On this page

Search results