Documentation

TermScheduleRepositoryInterface
in

Persistence for FSRS memory state and review history.

Table of Contents

Methods

countDue()  : int
Number of terms whose next review is due at or before now.
find()  : MemoryState|null
Load a term's memory state, or null if it has never been graded.
findOrSeed()  : MemoryState|null
Load a term's memory state, falling back to a seed derived from its legacy WoStatus/WoStatusChanged when it has never been graded.
saveReview()  : void
Persist memory state and append the matching review_log row.

Methods

countDue()

Number of terms whose next review is due at or before now.

public countDue([int|null $languageId = null ]) : int
Parameters
$languageId : int|null = null

Restrict to one language, or null for all

Return values
int

findOrSeed()

Load a term's memory state, falling back to a seed derived from its legacy WoStatus/WoStatusChanged when it has never been graded.

public findOrSeed(int $wordId) : MemoryState|null

Returns null for a term that does not exist, is not owned by the current user, or whose status is not schedulable (98 ignored / 99 well-known).

Parameters
$wordId : int
Tags
see
LegacyStatusSeed
Return values
MemoryState|null

saveReview()

Persist memory state and append the matching review_log row.

public saveReview(int $wordId, SchedulingResult $result, Rating $rating, int $stateBefore) : void

Both writes happen together: the log is the audit trail for the state, so a state change without its log entry would corrupt any later parameter optimisation.

Parameters
$wordId : int
$result : SchedulingResult
$rating : Rating
$stateBefore : int
On this page

Search results