OpenSkill\Datatable\Providers\CollectionProvider::setupSearch PHP Метод

setupSearch() публичный Метод

public setupSearch ( )
    public function setupSearch()
    {
        /**
         * @param array $data the generated data for this row
         * @param string $search the search value to look for
         * @param ColumnConfiguration[] $columns the configuration of the columns
         * @return bool true if the row should be included in the result, false otherwise
         */
        $this->defaultGlobalSearchFunction = function ($data, $search, array $columns) {
            foreach ($columns as $column) {
                if ($column->getSearch()->isSearchable() && str_contains(mb_strtolower($data[$column->getName()]), mb_strtolower($search))) {
                    return true;
                }
            }
            return false;
        };
    }