function = $function; $this->columnToFilter = $columnToFilter; $this->functionParams = $functionParams; } /** * Filters the given data table * * @param DataTable $table */ public function filter($table) { foreach ($table->getRows() as $key => $row) { $columnValue = $row->getColumn($this->columnToFilter); if (!call_user_func_array($this->function, array_merge(array($columnValue), $this->functionParams))) { $table->deleteRow($key); } $this->filterSubTable($row); } } }