private function transformCollectionData($columnConfiguration, $searchFunc)
    {
        $this->collection->transform(function ($data) use ($columnConfiguration, $searchFunc) {
            $entry = [];
            // for each column call the callback
            foreach ($columnConfiguration as $i => $col) {
                $func = $col->getCallable();
                $entry[$col->getName()] = $func($data);

                if ($this->queryConfiguration->hasSearchColumn($col->getName())) {
                    // column search exists, so check if the column matches the search
                    if (!$this->columnSearchFunction[$col->getName()]($entry,
                        $this->queryConfiguration->searchColumns()[$col->getName()])
                    ) {
                        // did not match, so return an empty array, the row will be removed later
                        return [];
                    }
                }
            }

            // also do search right away
            if ($this->queryConfiguration->isGlobalSearch()) {
                if (!$searchFunc($entry, $this->queryConfiguration->searchValue(), $this->columnConfiguration)) {
                    $entry = [];
                }
            }
            return $entry;
        });
    }