Last active
July 10, 2024 21:20
-
-
Save popovserhii/43565f0732e069f0af2faced959b0671 to your computer and use it in GitHub Desktop.
Apply filters to DataSource of Datagrid
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use ZfcDatagrid\Library\FilterHelper; | |
use Popov\DatagridBundle\Renderer\Json\Renderer; | |
$this->abstractFactory->setDataSource(...func_get_args()); | |
$filterColumn = $this->abstractFactory->getFilterColumn(); | |
$retriever = $this->abstractFactory->getRetriever(); | |
// Apply filters | |
$filters = FilterHelper::merge($this->process(), $this->newFilters); | |
$filterGroup = (new Renderer()) | |
->setIgnoredFilters($this->ignoredFilters) | |
->setIgnoredGroupsBy($this->ignoredGroupsBy) | |
->prepareFilters($filters); | |
$filterColumn->applyFilters($filterGroup); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment