get where clause for search results

@return string where clause
190588
public function getWhere()
    {
        $where = '';

        // add boolean where clause for searchwords
        if ($this->pObj->wordsAgainst != '') {
            $where .= ' AND MATCH (title, content) AGAINST (\'' . $this->pObj->wordsAgainst . '\' IN BOOLEAN MODE) ';
        }

        // add boolean where clause for tags
        if (($tagWhere = $this->createQueryForTags($this->pObj->tagsAgainst))) {
            $where .= $tagWhere;
        }

        // restrict to storage page
        $where .= ' AND pid in (' . $this->pObj->startingPoints . ') ';

        // add language
        $lang = intval($GLOBALS['TSFE']->sys_language_uid);
        $where .= ' AND language IN(' . $lang . ', -1) ';

        // add "tagged content only" searchphrase
        if ($this->conf['showTaggedContentOnly']) {
            $where .= ' AND tags <> ""';
        }

        // add enable fields
        $pageRepository = GeneralUtility::makeInstance(PageRepository::class);
        $where .= $pageRepository->enableFields($this->table);

        return $where;
    }
1054573
public function where()
    {
        $args = func_get_args();
        $cond = $this->condition();
        $cond = call_user_func_array(array($cond, 'where'), $args);
        return $cond;
    }
43012
public function getSearchQuery()
    {
        if (isset($_REQUEST['Search'])) {
            return DBField::create_field('HTMLText', $_REQUEST['Search']);
        } elseif (isset($_REQUEST['q'])) {
            return DBField::create_field('HTMLText', $_REQUEST['q']);
        }
    }
1277097
private function getSQLForSelect()
    {
        $query = 'SELECT ' . implode(', ', $this->sqlParts['select']);

        $query .= ($this->sqlParts['from'] ? ' FROM ' . implode(', ', $this->getFromClauses()) : '')
            . ($this->sqlParts['where'] !== null ? ' WHERE ' . ((string) $this->sqlParts['where']) : '')
            . ($this->sqlParts['groupBy'] ? ' GROUP BY ' . implode(', ', $this->sqlParts['groupBy']) : '')
            . ($this->sqlParts['having'] !== null ? ' HAVING ' . ((string) $this->sqlParts['having']) : '')
            . ($this->sqlParts['orderBy'] ? ' ORDER BY ' . implode(', ', $this->sqlParts['orderBy']) : '');

        if ($this->isLimitQuery()) {
            return $this->connection->getDatabasePlatform()->modifyLimitQuery(
                $query,
                $this->maxResults,
                $this->firstResult
            );
        }

        return $query;
    }
502130
private function getWhereInString()
    {
        // String holder
        $string = '';

        // If there are not where in conditions, return empty
        if (!count($this->whereIn)) {
            return $string;
        }

        // Iterate where creating the full conditions
        foreach ($this->whereIn as $where) {
            $string .= ' AND ' . $where['column'] . ' IN (' . implode(', ', $where['values']) . ')';
        }

        // Return complete where in string
        return $string;
    }
829344
public function get_sql_where() {
        list($where, $params) = parent::get_sql_where();
        $where = preg_replace('/firstname/', 'u.firstname', $where);
        $where = preg_replace('/lastname/', 'u.lastname', $where);
        return [$where, $params];
    }
855845
protected function findByParams($where)
    {
        $model = $this->makeModel()->getModel()->widgetParams()->getModel()->newQuery();
        return $model->where($where)->get()->toArray();
    }
1106428
protected function getWhere(array $queryParts)
    {
        if (!isset($queryParts['where']) || empty($queryParts['where'])) {
            return null;
        }

        $where = array();
        foreach ($queryParts['where'] as $w) {
            $where[] = $this->formatWhere($w);
        }

        return 'WHERE ' . implode(' AND ', $where);
    }
369164
def where(cls, where_clause="", start_position="", max_results="", qb=None):
        
        if where_clause:
            where_clause = "WHERE " + where_clause

        if start_position:
            start_position = " STARTPOSITION " + str(start_position)

        if max_results:
            max_results = " MAXRESULTS " + str(max_results)

        select = "SELECT * FROM {0} {1}{2}{3}".format(
            cls.qbo_object_name, where_clause, start_position, max_results)

        return cls.query(select, qb=qb)
531894
private function getSelectQuery()
    {
        return 'SELECT '.(empty($this->parts['select']) ? '*' : implode(', ', $this->parts['select'])).
               ' FROM '.$this->getFromClause().
               (($this->parts['where'] !== null) ? ' WHERE '.$this->parts['where'] : null).
               (!empty($this->parts['group_by']) ? ' GROUP BY '.implode(', ', $this->parts['group_by']) : null).
               (($this->parts['having'] !== null) ? ' HAVING '.$this->parts['having'] : null).
               (!empty($this->parts['order_by']) ? ' ORDER BY '.implode(', ', $this->parts['order_by']) : null).
               (($this->parts['limit'] !== null) ? ' LIMIT '.$this->parts['limit'] : null).
               (($this->parts['offset'] !== null) ? ' OFFSET '.$this->parts['offset'] : null);
    }
197923
public function getQuery()
    {
        // We need to ensure we have at least one filter, as
        // no query results will be returned otherwise.
        if (count(array_filter($this->filters)) === 0) {
            $this->whereHas($this->schema->objectClass());
        }

        return $this->grammar->compile($this);
    }
1247602
protected function compileWheres()
	{
		if (!$this->wheres) return array();

		// The new list of compiled wheres
		$wheres = array();

		foreach ($this->wheres as $i => &$where)
		{
			// Convert id's
			if (isset($where['column']) && $where['column'] == '_id')
			{
				// Multiple values
				if (isset($where['values']))
				{
					foreach ($where['values'] as &$value)
					{
						$value = $this->convertKey($value);
					}
				}
				// Single value
				elseif (isset($where['value']))
				{
					$where['value'] = $this->convertKey($where['value']);
				}
			}

			// Convert dates
			if (isset($where['value']) && $where['value'] instanceof DateTime)
			{
				$where['value'] = $where['value']->format(DateTime::ISO8601);
			}

			// First item of chain
			if ($i == 0 && count($this->wheres) > 1 && $where['boolean'] == 'and')
			{
				// Copy over boolean value of next item in chain
				$where['boolean'] = $this->wheres[$i+1]['boolean'];
			}

			// Delegate
			$method = "compileWhere{$where['type']}";
			$compiled = $this->{$method}($where);

			// Check for or
			if ($where['boolean'] == 'or')
			{
				$compiled = array('$or' => array($compiled));
			}

			// Merge compiled where
			$wheres = array_merge_recursive($wheres, $compiled);
		}

		return $wheres;
	}
970161
final public function getQuery()
    {
        if (null === $this->query) {

            $this->query = $this->buildQuery();

            // Apply conditions.
            foreach ($this->conditions as $statement => $value) {
                $this->applyOperator($this->query, $statement, $value);
            }

            $limit = $this->getLimit();

            if (CursorInterface::LIMIT_NONE !== $limit) {
                $this->query->range($this->getOffset(), $limit);
            }
        }

        return $this->query;
    }
868658
protected function buildWheres()
    {
        if (count($this->where) === 0) {
            return '';
        }

        // Use a ConditionSet to build the wheres
        $conditionSet = new Query\Condition\AndSet($this, $this->where);
        return "WHERE {$conditionSet->buildWithoutParentheses()}";
    }
349260
public function getRawQuery()
    {
        $sql = array();

        foreach ($this->getClauses() as $clause) {
            if (!$clause->isEmpty()) {
                $sql[] = $clause;
            }
        }

        return implode(' ', $sql);
    }
608884
public function searchText()
    {
        $query = $this->newQuery();
        if (Request::get('admin_text_search')) {
            foreach ($this->adminFilters['text_search']['db_fields'] as $field) {
                $query->orWhere($field, 'LIKE', '%'.Request::get('admin_text_search').'%');
            }
        }

        return $query;
    }
574
public function findWhere($conditions=null, $_=null)
    {
        $query =  $this->db->select($this->getColumns())
            ->from($this->entity->getTable());
        $query->context->resultHandler = function ($result){
            foreach ($result as &$i){
                $i = $this->entity->make($i, false);
            }
            return $result;
        };
        return call_user_func_array([$query, 'where'], func_get_args());
    }