Прнименяет условие на выборку "IN"
@param ISelectBuilder $selectBuilder
@return $this
8441
protected function applyInCondition(ISelectBuilder $selectBuilder)
    {
        $selectBuilder->expr($this->fieldColumn, $this->operator, $this->placeholder);
        $selectBuilder->bindArray($this->placeholder, $this->expression);

        return $this;
    }
1135522
private function buildSelectGroupByPart(ISelectBuilder $query)
    {
        $conditions = $query->getGroupByConditions();
        if (!count($conditions)) {
            return '';
        }

        $result = [];
        foreach ($conditions as $column => $direction) {
            $result[] = $this->quoteIdentifier($column);
        }

        return "\nGROUP BY " . implode(", ", $result);
    }
1176954
public function select(ODataQuerySelect $select = NULL) {
        if (isset($select)) {
            $this->setSelect($select);
            return $this;
        }
        return $this->getSelect();
    }
1042739
protected function addSelectsToQuery(Builder $query, array $selects)
    {
        if (!empty($selects)) {
            $query->selectRaw('max(' . implode(' + ', $selects) . ') as relevance', $this->searchBindings);
        }
    }
1198468
public function select(): IResult
    {
        $builder = new SelectBuilder($this);
        $sql = $builder->build();
        if(!$this->isInitQueryType && !$this->isInTransaction())
        {
            $this->queryType = QueryType::READ;
        }
        return $this->execute($sql);
    }
134437
public QueryBuilder<T, ID> joinOr(QueryBuilder<?, ?> joinedQueryBuilder) throws SQLException {
		addJoinInfo(JoinType.INNER, null, null, joinedQueryBuilder, JoinWhereOperation.OR);
		return this;
	}
1125347
public function extendQueryBuilder(QueryBuilder $queryBuilder)
    {
        $queryBuilder
            ->setFirstResult($this->getFirstResult())
            ->setMaxResults($this->getLimit());

        return $this;
    }
858093
private function buildSelectGroupByPart(ISelectBuilder $query)
    {
        $conditions = $query->getGroupByConditions();
        if (!count($conditions)) {
            return '';
        }

        $result = [];
        foreach ($conditions as $column => $direction) {
            $direction = strtoupper($direction);
            if ($direction == IQueryBuilder::ORDER_ASC) {
                $result[] = $this->quoteIdentifier($column);
            } else {
                $result[] = $this->quoteIdentifier($column) . ' ' . $direction;
            }
        }

        return "\nGROUP BY " . implode(", ", $result);
    }
661193
protected function applyLimitConditions(ISelectBuilder $selectBuilder)
    {
        if ($this->limit) {
            $postfix = self::PLACEHOLDER_SEPARATOR . $this->collection->getName();

            $limitPlaceholder = ':limit' . $postfix;
            $offsetPlaceholder = ':offset' . $postfix;

            $selectBuilder
                ->limit($limitPlaceholder)
                ->bindInt($limitPlaceholder, $this->limit);
            if ($this->offset) {
                $selectBuilder
                    ->offset($offsetPlaceholder)
                    ->bindInt($offsetPlaceholder, $this->offset);
            }
        }
    }
308589
protected function addCardNumber(FormBuilderInterface $builder)
    {
        $builder->add(
            self::FIELD_CARD_NUMBER,
            TextType::class,
            [
                'label' => false,
                'required' => false,
            ]
        );

        return $this;
    }
1299407
protected function applyJoins(ISelectBuilder $selectBuilder)
    {
        foreach ($this->resolvedFieldChains as $chain) {
            $chainLength = count($chain);
            for ($i = 0; $i < $chainLength - 1; $i++) {
                list ($relationField, $relationSourceAlias, $relationCollection) = $chain[$i];
                if (!$relationField instanceof IRelationField) {
                    continue;
                }

                $targetCollection = $chain[$i + 1][2];

                switch (true) {
                    case ($relationField instanceof HasOneRelationField):
                    {
                        /**
                         * @var HasOneRelationField $relationField
                         */
                        $this->applyJoinForHasManyRelation(
                            $selectBuilder,
                            $relationField,
                            $relationSourceAlias,
                            $relationCollection,
                            $targetCollection
                        );
                    }
                        break;
                    case ($relationField instanceof HasManyRelationField):
                    {
                        /**
                         * @var HasManyRelationField $relationField
                         */
                        $this->applyGroupByCollectionPk($selectBuilder);
                        $this->applyJoinForHasManyRelation(
                            $selectBuilder,
                            $relationField,
                            $relationSourceAlias,
                            $relationCollection,
                            $targetCollection
                        );
                    }
                        break;
                    case ($relationField instanceof BelongsToRelationField):
                    {
                        /**
                         * @var BelongsToRelationField $relationField
                         */
                        $this->applyJoinForBelongsToRelation(
                            $selectBuilder,
                            $relationField,
                            $relationSourceAlias,
                            $targetCollection
                        );
                    }
                        break;
                    case ($relationField instanceof ManyToManyRelationField):
                    {
                        $this->applyGroupByCollectionPk($selectBuilder);
                        /**
                         * @var ManyToManyRelationField $relationField
                         */
                        $this->applyJoinForManyToManyRelation(
                            $selectBuilder,
                            $relationField,
                            $relationSourceAlias,
                            $relationCollection,
                            $targetCollection
                        );
                    }
                        break;
                }
            }
        }
    }
1374829
public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        $event = $options['data'];
        $builder
            ->add('start', null, [
                'label' => 'event.form.start',
                'date_widget' => 'single_text',
                'time_widget' => 'single_text',
            ])
            ->add('end', null, [
                'label' => 'event.form.end',
                'date_widget' => 'single_text',
                'time_widget' => 'single_text',
            ])
            ->add('name', null, [
                'label' => 'event.form.name',
            ])
            ->add('location', null, [
                'label' => 'event.form.location',
            ])
            ->add('description', CKEditorType::class, [
                'label' => 'event.form.description',
                'required' => false,
                'config' => ['toolbar' => 'basic'],
            ])
            ->add('full_company', CheckboxType::class, [
                'label' => 'event.form.full_company',
                'required' => false,
            ])
            ->add('invitations', CollectionType::class, [
                'label' => 'event.form.invitations',
                'entry_type' => InvitationType::class,
                'entry_options' => ['label' => false],
                'allow_add' => true,
                'allow_delete' => true,
                'by_reference' => false,
            ])
            ->add('colour', ChoiceType::class, [
                'label' => 'event.form.colour',
                'required' => false,
                'choices' => [
                    'event.form.colour_choices.red' => 'important',
                    'event.form.colour_choices.green' => 'success',
                    'event.form.colour_choices.yellow' => 'warning',
                    'event.form.colour_choices.blue' => 'info',
                    'event.form.colour_choices.dark' => 'inverse',
                    'event.form.colour_choices.purple' => 'special',
                ],
            ])
            ->add('active', ChoiceType::class, [
                // Show "unpublished" instead of active.
                'choice_loader' => new CallbackChoiceLoader(function () use ($event) {
                    yield 'event.form.status_choices.active' => true;
                    if (!$event->isPublished()) {
                        yield 'event.form.status_choices.unpublished' => false;
                    } else {
                        yield 'event.form.status_choices.archived' => false;
                    }
                }),
                'label' => 'event.form.status',
            ])
        ;
    }
649055
public function subquery( QueryBuilder $queryBuilder ) {
		$this->subqueries[] = $queryBuilder->getSPARQL( false );
		$this->usageValidator->trackDefinedVariables( implode( ' ', $queryBuilder->getSelects() ) );

		// @todo temp hack to add AS definitions to defined variables
		$regexHelper = new RegexHelper();
		$matches = $regexHelper->getMatches( 'AS \{variable}', implode( ' ', $queryBuilder->getSelects() ) );
		$this->usageValidator->trackDefinedVariables( $matches );

		return $this;
	}
408626
public function attachInputToFormBuilder(FormBuilder $formBuilder, $data = null)
    {
        //Convert the options to an array for the form builder
        $choices = array();
        $selected = array();
        foreach ($this->optionList as $option) {
            $choices[$option->getId()] = $option->getLabel();
            if ($option->getSelected()) {
                $selected[] = $option->getId();
            }
        }

        //Add a new multi choice field to the builder
        $formBuilder->add(
            $this->id,
            'choice',
            array(
                'label'     => $this->label,
                'choices'   => $choices,
                'multiple'  => true,
                'data'      => $selected,
                'required'  => $this->mandatory,
                'read_only' => $this->readOnly,
                'expanded'  => true,
                'data_class'=> null
            )
        );
    }
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);
        }
    }
295834
public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        $builder
            ->add('start', null, [
                'label' => 'event.form.start',
                'date_widget' => 'single_text',
                'time_widget' => 'single_text',
            ])
            ->add('end', null, [
                'label' => 'event.form.end',
                'date_widget' => 'single_text',
                'time_widget' => 'single_text',
            ])
            ->add('name', null, [
                'label' => 'event.form.name',
            ])
            ->add('description', CKEditorType::class, [
                'label' => 'event.form.description',
                'required' => false,
                'config' => ['toolbar' => 'basic'],
            ])
            ->add('full_company', CheckboxType::class, [
                'label' => 'event.form.full_company',
                'required' => false,
            ])
            ->add('invitations', CollectionType::class, [
                'label' => 'event.form.invitations',
                'entry_type' => InvitationType::class,
                'entry_options' => ['label' => false],
                'allow_add' => true,
                'allow_delete' => true,
                'by_reference' => false,
            ])
        ;
    }
1235862
public SqlBuilder select(final String what) {
    if (null == what) {
      this.select = null;
    } else {
      if (Strings.contains(what.toLowerCase(), "select")) {
        this.select = what;
      } else {
        this.select = "select " + what;
      }
    }
    return this;
  }