Documentation

ReviewRepositoryInterface

Repository interface for review/test operations.

This is a domain port defining the contract for test data persistence. Infrastructure implementations provide the actual database access.

Tags
since
3.0.0

Table of Contents

Methods

findNextWordForReview()  : ReviewWord|null
Find the next word for testing using spaced repetition algorithm.
getLanguageIdFromConfig()  : int|null
Get language ID from test configuration.
getLanguageName()  : string
Get language name from test configuration.
getLanguageSettings()  : array{name: string, dict1Uri: string, dict2Uri: string, translateUri: string, textSize: int, removeSpaces: bool, regexWord: string, rtl: bool, ttsVoiceApi: string|null}
Get language settings for test display.
getReviewCounts()  : array{due: int, total: int}
Get test counts (due today and total).
getSentenceForWord()  : array{sentence: string|null, found: bool}
Get a sentence containing the word for context.
getSentenceWithAnnotations()  : array{sentence: string|null, sentenceId: int|null, found: bool, annotations: array}
Get sentence with annotations for surrounding words.
getTableReviewSettings()  : array{edit: int, status: int, term: int, trans: int, rom: int, sentence: int, contextRom: int, contextTrans: int}
Get table test visibility settings.
getTableWords()  : array<string|int, ReviewWord>
Get all words for table test mode.
getTomorrowCount()  : int
Get count of words due tomorrow.
getWordStatus()  : int|null
Get current word status.
getWordText()  : string|null
Get word text by ID.
updateWordStatus()  : array{oldStatus: int, newStatus: int, oldScore: int, newScore: int}
Update word status during test.
validateSingleLanguage()  : array{valid: bool, langCount: int, error: string|null}
Validate that test selection contains only one language.

Methods

getLanguageSettings()

Get language settings for test display.

public getLanguageSettings(int $langId) : array{name: string, dict1Uri: string, dict2Uri: string, translateUri: string, textSize: int, removeSpaces: bool, regexWord: string, rtl: bool, ttsVoiceApi: string|null}
Parameters
$langId : int

Language ID

Return values
array{name: string, dict1Uri: string, dict2Uri: string, translateUri: string, textSize: int, removeSpaces: bool, regexWord: string, rtl: bool, ttsVoiceApi: string|null}

getSentenceForWord()

Get a sentence containing the word for context.

public getSentenceForWord(int $wordId, string $wordLc) : array{sentence: string|null, found: bool}

Finds a sentence with at least 70% known words for optimal learning.

Parameters
$wordId : int

Word ID

$wordLc : string

Lowercase word text

Return values
array{sentence: string|null, found: bool}

getSentenceWithAnnotations()

Get sentence with annotations for surrounding words.

public getSentenceWithAnnotations(int $wordId, string $wordLc) : array{sentence: string|null, sentenceId: int|null, found: bool, annotations: array}

Returns the sentence containing the word, along with translation and romanization data for all known words in the sentence.

Parameters
$wordId : int

Word ID

$wordLc : string

Lowercase word text

Return values
array{sentence: string|null, sentenceId: int|null, found: bool, annotations: array}

getTableReviewSettings()

Get table test visibility settings.

public getTableReviewSettings() : array{edit: int, status: int, term: int, trans: int, rom: int, sentence: int, contextRom: int, contextTrans: int}
Return values
array{edit: int, status: int, term: int, trans: int, rom: int, sentence: int, contextRom: int, contextTrans: int}

getWordStatus()

Get current word status.

public getWordStatus(int $wordId) : int|null
Parameters
$wordId : int

Word ID

Return values
int|null

Current status or null if not found

getWordText()

Get word text by ID.

public getWordText(int $wordId) : string|null
Parameters
$wordId : int

Word ID

Return values
string|null

Word text or null if not found

updateWordStatus()

Update word status during test.

public updateWordStatus(int $wordId, int $newStatus) : array{oldStatus: int, newStatus: int, oldScore: int, newScore: int}
Parameters
$wordId : int

Word ID

$newStatus : int

New status (1-5, 98, 99)

Return values
array{oldStatus: int, newStatus: int, oldScore: int, newScore: int}

validateSingleLanguage()

Validate that test selection contains only one language.

public validateSingleLanguage(ReviewConfiguration $config) : array{valid: bool, langCount: int, error: string|null}
Parameters
$config : ReviewConfiguration

Test configuration

Return values
array{valid: bool, langCount: int, error: string|null}

        
On this page

Search results