Documentation

WordListQueryService

Executes word list queries with filtering and pagination.

Handles counting, listing, and filtering word records from the database.

Tags
category

Lwt

author

HugoFara hugo.farajallah@protonmail.com

license

Unlicense http://unlicense.org/

link
https://hugofara.github.io/lwt/developer/api
since
3.0.0

Table of Contents

Methods

countWords()  : int
Count words matching the filter criteria.
getFilteredWordIds()  : array<string|int, int>
Get word IDs matching filter criteria (for 'all' actions).
getWordsList()  : array<string|int, mixed>
Get words list for display.
getWordsListWithWordCount()  : array<string|int, mixed>
Get words list with word count (for sort option 7).

Methods

countWords()

Count words matching the filter criteria.

public countWords(string $textId, string $whLang, string $whStat, string $whQuery, string $whTag[, array<string|int, mixed> $params = [] ]) : int
Parameters
$textId : string

Text ID filter (comma-separated IDs or empty)

$whLang : string

Language condition (with ? placeholders)

$whStat : string

Status condition

$whQuery : string

Query condition (with ? placeholders)

$whTag : string

Tag condition (with ? placeholders)

$params : array<string|int, mixed> = []

Merged binding parameters for filters

Return values
int

Number of matching words

getFilteredWordIds()

Get word IDs matching filter criteria (for 'all' actions).

public getFilteredWordIds(string $textId, string $whLang, string $whStat, string $whQuery, string $whTag[, array<string|int, mixed> $params = [] ]) : array<string|int, int>
Parameters
$textId : string

Text ID filter (comma-separated IDs or empty)

$whLang : string

Language condition (with ? placeholders)

$whStat : string

Status condition

$whQuery : string

Query condition (with ? placeholders)

$whTag : string

Tag condition (with ? placeholders)

$params : array<string|int, mixed> = []

Merged binding parameters for filters

Return values
array<string|int, int>

Array of word IDs

getWordsList()

Get words list for display.

public getWordsList(array{whLang?: string, whStat?: string, whQuery?: string, whTag?: string, textId?: string, params?: array} $filters, int $sort, int $page, int $perPage) : array<string|int, mixed>
Parameters
$filters : array{whLang?: string, whStat?: string, whQuery?: string, whTag?: string, textId?: string, params?: array}

Filter parameters

$sort : int

Sort column index

$page : int

Page number

$perPage : int

Items per page

Return values
array<string|int, mixed>

Array of word records

getWordsListWithWordCount()

Get words list with word count (for sort option 7).

public getWordsListWithWordCount(array{whLang?: string, whStat?: string, whQuery?: string, whTag?: string, textId?: string, params?: array} $filters, string $sortExpr) : array<string|int, mixed>
Parameters
$filters : array{whLang?: string, whStat?: string, whQuery?: string, whTag?: string, textId?: string, params?: array}

Filter parameters

$sortExpr : string

Sort expression

Return values
array<string|int, mixed>

Array of word records


        
On this page

Search results