PHP Класс OpenSkill\Datatable\Providers\CollectionProvider

Наследование: implements OpenSkill\Datatable\Providers\Provider
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( Collection $collection ) CollectionProvider constructor.
order ( callable $orderFunction ) Will accept a global search function for all columns.
prepareForProcessing ( OpenSkill\Datatable\Queries\QueryConfiguration $queryConfiguration, array $columnConfiguration ) : mixed Here the DTQueryConfiguration is passed to prepare the provider for the processing of the request.
process ( ) : ResponseData This method should process all configurations and prepare the underlying data for the view. It will arrange the data and provide the results in a DTData object.
search ( callable $searchFunction ) Will accept a global search function for all columns.
searchColumn ( string $columnName, callable $searchFunction ) Will accept a search function that should be called for the column with the given name.
setupOrder ( )
setupSearch ( )

Приватные методы

Метод Описание
compileCollection ( array $columnConfiguration ) Will compile the collection into the final collection where operations like search and order can be applied.
removeEmptyRowsFromCollection ( ) Remove the empty rows from the collection
sortCollection ( ) Will sort the internal collection based on the given query configuration.
transformCollectionData ( OpenSkill\Datatable\Columns\ColumnConfiguration[] $columnConfiguration, $searchFunc ) Transform collection data. Used for searches.

Описание методов

__construct() публичный Метод

CollectionProvider constructor.
public __construct ( Collection $collection )
$collection Illuminate\Support\Collection The collection with the initial data

order() публичный Метод

Will accept a global search function for all columns.
public order ( callable $orderFunction )
$orderFunction callable the order function to determine the order of the table

prepareForProcessing() публичный Метод

This will only be called when the DTProvider needs to handle the request. It will never be called when the DTProvider does not need to handle the request.
public prepareForProcessing ( OpenSkill\Datatable\Queries\QueryConfiguration $queryConfiguration, array $columnConfiguration ) : mixed
$queryConfiguration OpenSkill\Datatable\Queries\QueryConfiguration
$columnConfiguration array
Результат mixed

process() публичный Метод

It will be called after {@link #prepareForProcessing} has been called and needs to return the processed data in a DTData object so the Composer can further handle the data.
public process ( ) : ResponseData
Результат OpenSkill\Datatable\Data\ResponseData The processed data

searchColumn() публичный Метод

If the function returns true, it will be accepted as search matching
public searchColumn ( string $columnName, callable $searchFunction )
$columnName string the name of the column to pass this function to
$searchFunction callable the function for the searching

setupOrder() публичный Метод

public setupOrder ( )

setupSearch() публичный Метод

public setupSearch ( )