vendor/yajra/laravel-datatables-oracle/src/Engines/QueryBuilderEngine.php
/**
     * Perform global search for the given keyword.
     *
     * @param string $keyword
     */
Perform global search for the given keyword.
@param string $keyword
Perform global search for the given keyword . @param string $keyword
private function globalSearch($keyword)
    {
        $this->query->where(
            function ($query) use ($keyword) {
                $queryBuilder = $this->getQueryBuilder($query);
                foreach ($this->request->searchableColumnIndex() as $index) {
                    $columnName = $this->getColumnName($index);
                    if ($this->isBlacklisted($columnName) && ! $this->hasCustomFilter($columnName)) {
                        continue;
                    }
                    if ($this->hasCustomFilter($columnName)) {
                        $columnDef = $this->columnDef['filter'][$columnName];
                        $applyGlobalSearch = count($columnDef['parameters']) == 0 || end($columnDef['parameters']) !== false;
                        if (! $applyGlobalSearch) {
                            continue;
                        }
                        if ($columnDef['method'] instanceof Closure) {
                            $whereQuery = $queryBuilder->newQuery();
                            call_user_func_array($columnDef['method'], [$whereQuery, $keyword]);
                            $queryBuilder->addNestedWhereQuery($whereQuery, 'or');
                        } else {
                            $this->compileColumnQuery(
                                $queryBuilder,
                                Helper::getOrMethod($columnDef['method']),
                                $columnDef['parameters'],
                                $columnName,
                                $keyword
                            );
                        }
                    } else {
                        if (count(explode('.', $columnName)) > 1) {
                            $eagerLoads     = $this->getEagerLoads();
                            $parts          = explode('.', $columnName);
                            $relationColumn = array_pop($parts);
                            $relation       = implode('.', $parts);
                            if (in_array($relation, $eagerLoads)) {
                                $this->compileRelationSearch(
                                    $queryBuilder,
                                    $relation,
                                    $relationColumn,
                                    $keyword
                                );
                            } else {
                                $this->compileQuerySearch($queryBuilder, $columnName, $keyword);
                            }
                        } else {
                            $this->compileQuerySearch($queryBuilder, $columnName, $keyword);
                        }
                    }
                    $this->isFilterApplied = true;
                }
            }
        );
    }
private function globalSearch ( $ keyword ) { $ this -> query -> where ( function ( $ query ) use ( $ keyword ) { $ queryBuilder = $ this -> getQueryBuilder ( $ query ) ; foreach ( $ this -> request -> searchableColumnIndex ( ) as $ index ) { $ columnName = $ this -> getColumnName ( $ index ) ; if ( $ this -> isBlacklisted ( $ columnName ) && ! $ this -> hasCustomFilter ( $ columnName ) ) { continue ; } if ( $ this -> hasCustomFilter ( $ columnName ) ) { $ columnDef = $ this -> columnDef [ 'filter' ] [ $ columnName ] ; $ applyGlobalSearch = count ( $ columnDef [ 'parameters' ] ) == 0 || end ( $ columnDef [ 'parameters' ] ) !== false ; if ( ! $ applyGlobalSearch ) { continue ; } if ( $ columnDef [ 'method' ] instanceof Closure ) { $ whereQuery = $ queryBuilder -> newQuery ( ) ; call_user_func_array ( $ columnDef [ 'method' ] , [ $ whereQuery , $ keyword ] ) ; $ queryBuilder -> addNestedWhereQuery ( $ whereQuery , 'or' ) ; } else { $ this -> compileColumnQuery ( $ queryBuilder , Helper :: getOrMethod ( $ columnDef [ 'method' ] ) , $ columnDef [ 'parameters' ] , $ columnName , $ keyword ) ; } } else { if ( count ( explode ( '.' , $ columnName ) ) > 1 ) { $ eagerLoads = $ this -> getEagerLoads ( ) ; $ parts = explode ( '.' , $ columnName ) ; $ relationColumn = array_pop ( $ parts ) ; $ relation = implode ( '.' , $ parts ) ; if ( in_array ( $ relation , $ eagerLoads ) ) { $ this -> compileRelationSearch ( $ queryBuilder , $ relation , $ relationColumn , $ keyword ) ; } else { $ this -> compileQuerySearch ( $ queryBuilder , $ columnName , $ keyword ) ; } } else { $ this -> compileQuerySearch ( $ queryBuilder , $ columnName , $ keyword ) ; } } $ this -> isFilterApplied = true ; } } ) ; }
Perform global search for the given keyword.
Perform global search for the given keyword .
// check if custom column filtering is applied // check if global search should be applied for the specific column