PHP Class OpenSkill\Datatable\Composers\ColumnComposer

Mostrar archivo Open project: openskill/datatable Class Usage Examples

Public Methods

Method Description
__construct ( OpenSkill\Datatable\Providers\Provider $provider, VersionEngine $versionEngine, Illuminate\Contracts\View\Factory $viewFactory, Illuminate\Contracts\Config\Repository $configRepository ) Will create a new datatable composer instance with the given provider
add ( OpenSkill\Datatable\Columns\ColumnConfiguration $configuration ) This method will add the given ColumnConfiguration to the composer.
build ( ) : DatatableService
column ( string $name, string | callable $callable = null, Searchable $searchable = null, OpenSkill\Datatable\Columns\Orderable\Orderable $orderable = null ) Will create a new ColumnConfiguration with all defaults but allows overriding of all properties through the method.
getColumnConfiguration ( ) : OpenSkill\Datatable\Columns\ColumnConfiguration[] Will return the internal column configurations that are registered with the current composer.
getProvider ( ) : OpenSkill\Datatable\Providers\Provider Will return the Provider for the underlying data.

Private Methods

Method Description
setCallableColumn ( $config, $callable ) Determine a sane configuration value for a column's callable function

Method Details

__construct() public method

Will create a new datatable composer instance with the given provider
public __construct ( OpenSkill\Datatable\Providers\Provider $provider, VersionEngine $versionEngine, Illuminate\Contracts\View\Factory $viewFactory, Illuminate\Contracts\Config\Repository $configRepository )
$provider OpenSkill\Datatable\Providers\Provider the provider that will process the underlying data
$versionEngine OpenSkill\Datatable\Versions\VersionEngine The version engine to handle the request data
$viewFactory Illuminate\Contracts\View\Factory The factory providing the views
$configRepository Illuminate\Contracts\Config\Repository The repository providing the user defined options

add() public method

This method will add the given ColumnConfiguration to the composer.
public add ( OpenSkill\Datatable\Columns\ColumnConfiguration $configuration )
$configuration OpenSkill\Datatable\Columns\ColumnConfiguration the configuration to add to the composer

build() public method

public build ( ) : DatatableService
return OpenSkill\Datatable\DatatableService Will return the fully built DatatableService that will contain the ColumnConfiguration

column() public method

Will create a new ColumnConfiguration with all defaults but allows overriding of all properties through the method.
public column ( string $name, string | callable $callable = null, Searchable $searchable = null, OpenSkill\Datatable\Columns\Orderable\Orderable $orderable = null )
$name string The name of the configuration, required for the configuration
$callable string | callable The function to execute, defaults to null which means the default will be set.
$searchable OpenSkill\Datatable\Columns\Searchable\Searchable If the column should be searchable or not
$orderable OpenSkill\Datatable\Columns\Orderable\Orderable If the column should be orderable or not

getColumnConfiguration() public method

Will return the internal column configurations that are registered with the current composer.
public getColumnConfiguration ( ) : OpenSkill\Datatable\Columns\ColumnConfiguration[]
return OpenSkill\Datatable\Columns\ColumnConfiguration[]

getProvider() public method

Will return the Provider for the underlying data.
public getProvider ( ) : OpenSkill\Datatable\Providers\Provider
return OpenSkill\Datatable\Providers\Provider