Kreyu / data-table-bundle

Streamlines creation process of the data tables in Symfony applications. NOT PRODUCTION READY.
https://data-table-bundle.swroblewski.pl
MIT License
75 stars 14 forks source link

Add `create` methods to `DataTableBuilderInterface` #100

Closed Kreyu closed 4 months ago

Kreyu commented 4 months ago

Similar to Symfony Form FormBuilderInterface, the DataTableBuilderInterface should contain create methods to create instances of column, filter, action and exporter builders:

public function createColumn(string $name, ?string $type = null, array $options = []): ColumnBuilderInterface;

public function createFilter(string $name, ?string $type = null, array $options = []): FilterBuilderInterface;

public function createAction(string $name, ?string $type = null, array $options = []): ActionBuilderInterface;

public function createRowAction(string $name, ?string $type = null, array $options = []): ActionBuilderInterface;

public function createBatchAction(string $name, ?string $type = null, array $options = []): ActionBuilderInterface;

public function createExporter(string $name, ?string $type = null, array $options = []): ExporterBuilderInterface;

This provides a nicer builder API, for example, for #96