Builds the query with the given category.

@return Builder
164728
public function query() : Builder
	{
		if (trim($brand = $this->brand) !== '') {
			$this->builder->where('brand', 'LIKE', $brand);
		}

		return $this->builder;
	}
1017967
private function getCategoryQuery()
    {
        return $this->createQueryBuilder('category')
            ->leftJoin('category.meta', 'categoryMeta')
            ->leftJoin('category.translations', 'categoryTranslations')
            ->leftJoin('categoryTranslations.keywords', 'categoryKeywords')
            ->leftJoin('category.parent', 'categoryParent')
            ->leftJoin('category.children', 'categoryChildren')
            ->addSelect('categoryMeta')
            ->addSelect('categoryTranslations')
            ->addSelect('categoryKeywords')
            ->addSelect('categoryParent')
            ->addSelect('categoryChildren');
    }
814241
public function query()
    {
        $articles = Article::query()->with('category', 'creator')->select('articles.*');

        if ($this->request()->input('category')) {
            $articles->whereHas('category', function ($query) {
                $query->where('categories.id', request('category'));
            });
        }

        if ($this->request()->input('is_page') <> '') {
            $articles->where('is_page', request('is_page'));
        }

        if ($this->request()->input('status') <> '') {
            $articles->where('published', request('status'));
        }

        return $this->applyScopes($articles);
    }
697141
protected function buildQuery()
    {
        /** @var Search $search */
        $search = $this->repository->createSearch();
        $search->setSize($this->limit);
        $search->addSort(new Sort('left', Sort::ORDER_ASC));
        $search->addQuery(new TermQuery('active', true), 'must');
        if (!$this->loadHiddenCategories) {
            $search->addQuery(new TermQuery('is_hidden', 0), 'must');
        }

        return $search;
    }
154699
public function buildQuery()
    {
        $this->setSelectFrom();
        $this->setLeftJoins($this->qb);
        $this->setWhere($this->qb);
        $this->setWhereResultCallback($this->qb);
        $this->setWhereAllCallback($this->qb);
        $this->setOrderBy();
        $this->setLimit();

        return $this;
    }
31623
public function categories()
    {
        $findPostType = PostType::findBySlug($this->getTable());
        if(!$findPostType) {
            throw new \Exception("Categories  relations could not be made because the post type of the post #".$this->postID." could ont be found!");
        }
        return $this->customHasManyThrough(
            'App\Models\Category', 'App\Models\CategoryRelation',
            'postID', 'categoryID', 'postID', 'categoryID', $this->getTable()."_categories"
        )
            ->where('postTypeID', $findPostType->postTypeID);
    }
846360
public function apply($constraints) : Builder
	{
		if ($constraints && $this->type == 'product_categories') {
			return $this->builder->whereIn('category_id', $constraints);
		}

		if ($constraints && is_array($constraints)) {
			return $this->filterByConstraints($constraints);
		}

		return $this->builder;
	}
700546
private function loadCategory()
    {
        $category   = $this->categoryFactory->create();
        $storeId    = $this->getRequest()->getParam('store');
        $categoryId = $this->getRequest()->getParam('entity_id');

        $category->setStoreId($storeId)->load($categoryId);

        return $category;
    }
2444
public function getCategorySearchQuery(
        ContainerConfigurationInterface $containerConfigurationInterface,
        CategoryInterface $category
    ) {
        $filters = array_merge(
            ['category' => $this->categoryFilterProvider->getQueryFilter($category)],
            $containerConfigurationInterface->getFilters()
        );

        $filterQuery  = $this->queryBuilder->createFilterQuery($containerConfigurationInterface, $filters);

        return $this->queryFactory->create(QueryInterface::TYPE_FILTER, ['filter' => $filterQuery]);
    }
537033
public static function queryMetas()
	{
		$model = new static;
		
		$conn = $model->getConnection();
		$query = new QueryBuilder(
			$conn,
			$conn->getQueryGrammar(),
			$conn->getPostProcessor()
		);
		
		$query->setModel($model);
		
		return $query;
	}
641334
public function queryBuilder()
    {
        if (!$this->queryBuilder) {
            $this->queryBuilder = $this->grid->model()->getQueryBuilder();
        }

        return $this->queryBuilder;
    }
998729
public function createQueryBuilder()
	{
		$q = $this->flupdo->select();
		$this->queryAddFrom($q);
		$this->queryAddAccessPolicyCondition($this->read_access_policy, $q);
		return $q;
	}
374323
protected function buildQuery()
	{
		$this->setup();

		$query = array();

		// Index always needs to be provided. _all means a cross index search.
		$query['index'] = empty($this->indices) ? '_all' : implode(',', array_values($this->indices));

		// Type is not required, will search in the entire index.
		if (!empty($this->types)) {
			$query['type'] = implode(',', array_values($this->types));
		}

		// Replace Fragments with their raw body.
		$query['body'] = $this->fragmentParser->parse($this->body);

		// Add all query string params, the SDK will only add known params to the URL.
		foreach ($this->queryStringParams as $paramName => $paramValue) {
			$query[$paramName] = $paramValue;
		}

		return $query;
	}
909320
private function buildQuery()
    {
        $this->datatableQuery->setSelectFrom();
        $this->datatableQuery->setLeftJoins();
        $this->datatableQuery->setWhere();
        $this->datatableQuery->setWhereCallbacks();
        $this->datatableQuery->setOrderBy();
        $this->datatableQuery->setLimit();

        return $this;
    }
1367382
protected function getListCategory()
    {
        $conditions = $this->query_filter;
        $conditions['category_group_id'] = $this->data_category_group['category_group_id'];
        $list = $this->category->getTree($conditions);

        $this->prepareListCategory($list);
        return $list;
    }
219677
public function newEloquentBuilder($query)
    {
        $builder = new TaxonomyBuilder($query);

        return isset($this->taxonomy) && $this->taxonomy ? $builder->where('taxonomy', $this->taxonomy) : $builder;
    }
122367
public function query() {
        $builder = $this->getServiceLocator()->get($this->builderClassName);
        $builder->setOptions($this->options)->setServiceLocator($this->serviceLocator);
        return $builder;
    }