Updates the query builder according to this clause. This is called by the query builder only.

@param Builder $objBuilder
@throws Caller
550831
public function _UpdateQueryBuilder(Builder $objBuilder)
    {
        $intLength = count($this->objNodeArray);
        for ($intIndex = 0; $intIndex < $intLength; $intIndex++) {
            $objNode = $this->objNodeArray[$intIndex];
            if ($objNode instanceof Node\Virtual) {
                if ($objNode->hasSubquery()) {
                    throw new Caller('You cannot define a virtual node in an order by clause. You must use an Expand clause to define it.');
                }
                $strOrderByCommand = '__' . $objNode->getAttributeName();
            } elseif ($objNode instanceof Node\Column) {
                /** @var Node\Column $objNode */
                $strOrderByCommand = $objNode->getColumnAlias($objBuilder);
            } elseif ($objNode instanceof iCondition) {
                /** @var iCondition $objNode */
                $strOrderByCommand = $objNode->getWhereClause($objBuilder);
            } else {
                $strOrderByCommand = '';
            }

            // Check to see if they want a ASC/DESC declarator
            if ((($intIndex + 1) < $intLength) &&
                !($this->objNodeArray[$intIndex + 1] instanceof Node\NodeBase)
            ) {
                if ((!$this->objNodeArray[$intIndex + 1]) ||
                    (trim(strtolower($this->objNodeArray[$intIndex + 1])) == 'desc')
                ) {
                    $strOrderByCommand .= ' DESC';
                } else {
                    $strOrderByCommand .= ' ASC';
                }
                $intIndex++;
            }

            $objBuilder->addOrderByItem($strOrderByCommand);
        }
    }
1135269
public void setQueryParamsBuilds(QueryParamsBuilder queryParamsBuilder) {
		PreconditionUtil.assertNotNull("A query params builder must be provided, but is null", queryParamsBuilder);
		this.queryParamsBuilder = queryParamsBuilder;
		this.querySpecDeserializer = null;
	}
1252692
public function evaluate(
        QueryBuilder $queryBuilder,
        CreatePaginator $annotation
    ) {
        foreach ($this->paginatorEvaluators as $paginatorEvaluator) {
            $paginatorEvaluator->evaluate($queryBuilder, $annotation);
        }
    }
1227248
public function before_update(Orm\Model $obj)
	{
		// If there are any relations loop through and check if any of them have been changed
		$relation_changed = false;

		foreach ($this->_relations as $relation)
		{
			if ($this->relation_changed($obj, $relation))
			{
				$relation_changed = true;
				break;
			}
		}

		if (($obj->is_changed() or $relation_changed) and $user_id = \Auth::get_user_id())
		{
			$obj->{$this->_property} = $user_id[1];
		}
	}
646152
public function adaptQueryBuilder(QueryBuilder $queryBuilder, array $params = array())
    {
        parent::adaptQueryBuilder($queryBuilder);
        $queryBuilder
                ->innerJoin('b.node', 'n', 'WITH', 'b.node = n.id')
                ->andWhere('n.id = :node')
                ->andWhere('b.lang = :lang')
                ->setParameter('node', $this->nodeTranslation->getNode()->getId())
                ->setParameter('lang', $this->nodeTranslation->getLang())
                ->addOrderBy('b.created', 'DESC');
    }
410753
public function createFromBuilder(Builder $builder)
    {
        $this->model = $builder->getModel();
        $this->query = $builder;

        $this->build();

        return $this;
    }
1233364
protected function addApprove(Builder $builder): void
    {
        $builder->macro('approve', function (Builder $builder) {
            $builder->withNotApproved();

            return $builder->update(['is_approved' => 1]);
        });
    }
938348
public function join(
        Builder $objBuilder,
        $blnExpandSelection = false,
        iCondition $objJoinCondition = null,
        Clause\Select $objSelect = null
    ) {
        $objParentNode = $this->objParentNode;
        if (!$objParentNode) {
            throw new Caller('A column node must have a parent node.');
        } else {
            // Here we pass the join condition on to the parent object
            $objParentNode->join($objBuilder, $blnExpandSelection, $objJoinCondition, $objSelect);
        }
    }
856680
protected function applyCriteria(QueryBuilder $queryBuilder, array $criteria = null)
    {
        if (null === $criteria) {
            return;
        }

        foreach ($criteria as $property => $value) {
            if (null === $value) {
                $queryBuilder
                    ->andWhere($queryBuilder->expr()->isNull($this->getPropertyName($property)));
            } elseif (!is_array($value)) {
                $queryBuilder
                    ->andWhere($queryBuilder->expr()->eq($this->getPropertyName($property), ':' . $property))
                    ->setParameter($property, $value);
            } else {
                $queryBuilder->andWhere($queryBuilder->expr()->in($this->getPropertyName($property), $value));
            }
        }
    }
571948
public function apply(Builder $builder, Model $model): void
    {
        if (empty($this->role)) {
            return;
        }

        $builder->whereHas('roles', function ($query) {
            $query->whereIn('name', (array) $this->role);
        });
    }
114534
protected function applySorts(ModelQueryBuilder $builder): self
    {
        if ($this->hasSorts() === true) {
            $builder->addSorts($this->getSorts());
        }

        return $this;
    }
160661
protected function addUpdatedAt(ModelQueryBuilder $builder): ModelQueryBuilder
    {
        // `Doctrine` specifics: `setValue` works for inserts and `set` for updates
        $timestamp = $this->convertDateTimeToDbValue($builder, new DateTimeImmutable());
        $builder->set(CommonFields::FIELD_UPDATED_AT, $builder->createNamedParameter($timestamp));

        return $builder;
    }
1124982
protected function alterListQuery(QueryBuilder $queryBuilder)
    {
        $entityManager = $this->getDoctrine()->getEntityManager();

        $queryBuilder->andWhere('e.menu = :menu');
        $queryBuilder->setParameter('menu', $entityManager->getReference('ClasticMenuBundle:Menu', $this->menuId));

        return $queryBuilder;
    }
824822
@Nonnull
	public static <T, R> LObjBoolFunctionBuilder<T, R> objBoolFunction(Consumer<LObjBoolFunction<T, R>> consumer) {
		return new LObjBoolFunctionBuilder(consumer);
	}
243300
public function updateQueryBuilder($builder) {

		// Make sure the extension requirements have been met before enabling the custom search index.

		if(SiteTree::has_extension('SolrIndexable') && SiteTree::has_extension('SiteTreePermissionIndexExtension') && ClassInfo::exists('QueuedJob')) {

			// Define the initial user permissions using the general public access flag.

			$groups = array(
				'anyone'
			);

			// Apply the logged in access flag and listing of groups for the current authenticated user.

			$user = Member::currentUser();
			if($user) {

				// Don't restrict the search results for an administrator.

				if(Permission::checkMember($user, array('ADMIN', 'SITETREE_VIEW_ALL'))) {
					return;
				}
				$groups[] = 'logged-in';
				foreach($user->Groups() as $group) {
					$groups[] = (string)$group->ID;
				}
			}

			// Apply this permission filter.

			$builder->andWith('Groups_ms', $groups);
		}
	}
955161
@Nonnull
	public static <T, R> LObjDblFunctionBuilder<T, R> objDblFunction(Consumer<LObjDblFunction<T, R>> consumer) {
		return new LObjDblFunctionBuilder(consumer);
	}
427479
private function remapBuilderColumns(Builder $builder): void {
    if($builder->aggregate === null) {
      if($builder->columns === ['*']) {
        $builder->columns = array_keys($this->to_db);
      }

      if(is_string($builder->columns)) {
        $builder->columns = [$builder->columns];
      }

      $this->remapColumns($builder->columns);
    } else {
      if($builder->aggregate['columns'] == ['*']) {
        return;
      }

      $this->remapColumns($builder->aggregate['columns'], false);
    }
  }