CreateTermFromHover
in package
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
Table of Contents
Properties
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
$vocabularyFacade
private
VocabularyFacade
$vocabularyFacade
Methods
__construct()
Constructor.
public
__construct([VocabularyFacade|null $vocabularyFacade = null ]) : mixed
Parameters
- $vocabularyFacade : VocabularyFacade|null = null
-
Vocabulary facade
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