DataTableRequest
DataTableRequest and related value objects wrap DataTables request payloads in typed PHP objects.
Main DTO
use Pentiminax\UX\DataTables\DataTableRequest\DataTableRequest;
$requestDto = DataTableRequest::fromRequest($request);
Fields:
| Field | Type | Description |
|---|---|---|
| `draw` | `?int` | Request counter used to sync responses |
| `columns` | `Columns` | Column metadata collection |
| `start` | `int` | Paging offset |
| `length` | `int` | Requested page size |
| `search` | `?Search` | Global search payload |
| `order` | `Order[]` | Sort instructions |
Nested DTOs
Columns
Methods:
| Method | Description |
|---|---|
| `getColumnByName(string $name): ?Column` | Resolve a column by configured name |
| `getColumnByIndex(int $index): ?Column` | Resolve a column by DataTables index |
Column
Fields:
| Field | Type | Description |
|---|---|---|
| `data` | `mixed` | Data key/path used by DataTables |
| `name` | `string` | Logical column name |
| `searchable` | `bool` | Whether the column can be searched |
| `orderable` | `bool` | Whether the column can be ordered |
| `search` | `?Search` | Per-column search payload |
| `columnControl` | `?ColumnControl` | Advanced filter payload from Column Control |
Order
Fields:
| Field | Type | Description |
|---|---|---|
| `column` | `int` | Column index to sort |
| `dir` | `string` | Sort direction (`asc` or `desc`) |
| `name` | `string` | Column name used for sorting |
Search
Fields:
| Field | Type | Description |
|---|---|---|
| `value` | `?string` | Search input value |
| `regex` | `bool` | Whether regex mode is requested |
ColumnControl / ColumnControlSearch
Used when Column Control extension sends advanced column filters:
| DTO | Shape | Description |
|---|---|---|
| `ColumnControl` | `search: ?ColumnControlSearch, list: array` | Column-level filter payload |
| `ColumnControlSearch` | `value: string, logic: string, type: string` | Search constraint details |