PHP Class OpenSkill\Datatable\DatatableService

Show file Open project: openskill/datatable Class Usage Examples

Public Methods

Method Description
__construct ( OpenSkill\Datatable\Providers\Provider $provider, OpenSkill\Datatable\Columns\ColumnConfiguration[] $columnConfigurations, VersionEngine $versionEngine, Illuminate\Contracts\View\Factory $viewFactory, Illuminate\Contracts\Config\Repository $configRepository ) DatatableService constructor.
handleRequest ( ) : Symfony\Component\HttpFoundation\JsonResponse Will handle the current request and returns the correct response
prepareRequest ( ) : OpenSkill\Datatable\Versions\Version Prepare a request for processing (without doing the actual datatable).
setVersion ( OpenSkill\Datatable\Versions\Version $version )
shouldHandle ( ) : boolean
view ( string $tableView = null, string $scriptView = null ) : DatatableView

Method Details

__construct() public method

DatatableService constructor.
public __construct ( OpenSkill\Datatable\Providers\Provider $provider, OpenSkill\Datatable\Columns\ColumnConfiguration[] $columnConfigurations, VersionEngine $versionEngine, Illuminate\Contracts\View\Factory $viewFactory, Illuminate\Contracts\Config\Repository $configRepository )
$provider OpenSkill\Datatable\Providers\Provider The provider that will prepare the data
$columnConfigurations OpenSkill\Datatable\Columns\ColumnConfiguration[]
$versionEngine OpenSkill\Datatable\Versions\VersionEngine
$viewFactory Illuminate\Contracts\View\Factory The factory to render the views
$configRepository Illuminate\Contracts\Config\Repository The repository to get the config values from

handleRequest() public method

Will handle the current request and returns the correct response
public handleRequest ( ) : Symfony\Component\HttpFoundation\JsonResponse
return Symfony\Component\HttpFoundation\JsonResponse the response that should be returned to the client.

prepareRequest() public method

Prepare a request for processing (without doing the actual datatable).
public prepareRequest ( ) : OpenSkill\Datatable\Versions\Version
return OpenSkill\Datatable\Versions\Version

setVersion() public method

public setVersion ( OpenSkill\Datatable\Versions\Version $version )
$version OpenSkill\Datatable\Versions\Version The version that should be used to generate the view and the responses

shouldHandle() public method

public shouldHandle ( ) : boolean
return boolean True if any version should handle the current request

view() public method

public view ( string $tableView = null, string $scriptView = null ) : DatatableView
$tableView string the view to use or null if the standard view should be used for the table and the script
$scriptView string the view to use or null if the standard view should be used for the table and the script
return OpenSkill\Datatable\Views\DatatableView