HelloSebastian / hello-bootstrap-table-bundle

Symfony Bundle to create HTML tables with bootstrap-table for Doctrine Entities.
MIT License
10 stars 4 forks source link

Add Count column #17

Closed HelloSebastian closed 3 years ago

HelloSebastian commented 3 years ago

Add CountColumn to provide a solution to display counts of OneToMany relations. CountColumn provide filter and sort functions and display the count of OneToMany relations in the table.

In this PR the column option search callback function interface was changed.

Before: 'search' => function (Composite $composite, QueryBuilder $qb, $dql, $search, $key) {}

After: 'search' => function (Composite $composite, QueryBuilder $qb, $search) {}

In the table you know the attribute name of the column. Therefore, the $dql parameter is no longer needed.

The $key parameter is used to uniquely bind the search parameters in the query. In the callback function you can provide a unique name for the search parameters yourself.