DocumentsTable
extends DashTable
in package
Table of Contents
Properties
- $collectionName : mixed
- $columns : mixed
- $currentPage : mixed
- $enableFilters : mixed
- $enablePagination : mixed
- $enableSearch : mixed
- $filters : mixed
- $items : mixed
- $partialMatch : mixed
- $perPage : mixed
- $searchQuery : mixed
- $totalItems : mixed
- $totalPages : mixed
Methods
- __construct() : mixed
- display() : mixed
- renderFilters() : mixed
- renderSearchAndPagination() : mixed
- resolveFilters() : mixed
- resolvePagination() : mixed
- resolveSearch() : mixed
- fetchItems() : mixed
- generateColumns() : mixed
- buildExactMatchParameters() : array<string|int, mixed>
- buildFilterString() : string
- Builds filter string from filter array (exact match mode).
- buildPartialMatchParameters() : array<string|int, mixed>
- buildSearchParameters() : array<string|int, mixed>
- Builds search parameters for the TypeSense query.
- generateColumnsFromSchema() : void
- Generates columns from the TypeSense collection schema.
- getArrayPreview() : string
- Returns a preview string for an array.
Properties
$collectionName
protected
mixed
$collectionName
$columns
protected
mixed
$columns
= []
$currentPage
protected
mixed
$currentPage
= 1
$enableFilters
protected
mixed
$enableFilters
= false
$enablePagination
protected
mixed
$enablePagination
= false
$enableSearch
protected
mixed
$enableSearch
= false
$filters
protected
mixed
$filters
= []
$items
protected
mixed
$items
= []
$partialMatch
protected
mixed
$partialMatch
= false
$perPage
protected
mixed
$perPage
= 25
$searchQuery
protected
mixed
$searchQuery
= ''
$totalItems
protected
mixed
$totalItems
= 0
$totalPages
protected
mixed
$totalPages
= 1
Methods
__construct()
public
__construct(string $collectionName[, mixed $enableSearch = true ][, mixed $enablePagination = true ][, mixed $enableFilters = true ]) : mixed
Parameters
- $collectionName : string
- $enableSearch : mixed = true
- $enablePagination : mixed = true
- $enableFilters : mixed = true
display()
public
display() : mixed
renderFilters()
public
renderFilters() : mixed
renderSearchAndPagination()
public
renderSearchAndPagination() : mixed
resolveFilters()
public
resolveFilters() : mixed
resolvePagination()
public
resolvePagination() : mixed
resolveSearch()
public
resolveSearch() : mixed
fetchItems()
protected
fetchItems() : mixed
generateColumns()
protected
generateColumns(array<string|int, mixed> $documents) : mixed
Parameters
- $documents : array<string|int, mixed>
buildExactMatchParameters()
private
buildExactMatchParameters(string $allSearchableFields) : array<string|int, mixed>
Parameters
- $allSearchableFields : string
Return values
array<string|int, mixed>buildFilterString()
Builds filter string from filter array (exact match mode).
private
buildFilterString() : string
Return values
stringbuildPartialMatchParameters()
private
buildPartialMatchParameters(string $allSearchableFields) : array<string|int, mixed>
Parameters
- $allSearchableFields : string
Return values
array<string|int, mixed>buildSearchParameters()
Builds search parameters for the TypeSense query.
private
buildSearchParameters() : array<string|int, mixed>
In partial match mode, filter values are fed into TypeSense's search query (q) with query_by scoped to the filtered fields, enabling token-based fuzzy matching. In exact mode, filters use filter_by with := operator.
Return values
array<string|int, mixed>generateColumnsFromSchema()
Generates columns from the TypeSense collection schema.
private
generateColumnsFromSchema() : void
Ensures filter inputs are always visible regardless of search results.
getArrayPreview()
Returns a preview string for an array.
private
getArrayPreview(array<string|int, mixed> $array) : string
If the array has one scalar value, returns it. If the array has more values, returns the first three key-value pairs. If a value is an array, replaces it with "[...]".
Parameters
- $array : array<string|int, mixed>
-
The array to preview.
Return values
string —The preview string.