@param SelectEvaluation $selectEvaluation

@return SelectEvaluation
184673
protected function getSelectEvaluation($selectEvaluation = null)
    {
        if (null !== $selectEvaluation && false === ($selectEvaluation instanceof SelectEvaluation)) {
            throw new \InvalidArgumentException('Argument "selectEvaluation" must be an instance of SelectEvaluation.');
        }
        if (null === $selectEvaluation) {
            $selectEvaluation = new SelectEvaluation;
        }

        foreach (FilterFactory::getFilters() as $filter) {
            $selectEvaluation->addFilter($filter);
        }

        return $selectEvaluation;
    }
785084
public function validationApplies()
    {
        $return = true;

        if ($criteria = $this->owner->validationLogicCriteria) {
            $fields = $this->owner->rootFieldList();
            if (eval($criteria->phpEvalString()) === false) {
                throw new Exception("There is a syntax error in the constaint logic phpEvalString \"{$criteria->phpEvalString()}\"");
            }
            $return = eval('return ' . $criteria->phpEvalString());
        }

        return $return;
    }
805514
public function walkSelectStatement(SelectStatement $AST)
    {
        $queryComponents = $this->_getQueryComponents();
        // Get the root entity and alias from the AST fromClause
        $from      = $AST->fromClause->identificationVariableDeclarations;
        $fromRoot  = reset($from);
        $rootAlias = $fromRoot->rangeVariableDeclaration->aliasIdentificationVariable;
        $rootClass = $queryComponents[$rootAlias]['metadata'];
        $selectExpressions = array();

        $this->validate($AST);

        foreach ($queryComponents as $dqlAlias => $qComp) {
            // Preserve mixed data in query for ordering.
            if (isset($qComp['resultVariable'])) {
                $selectExpressions[] = new SelectExpression($qComp['resultVariable'], $dqlAlias);
                continue;
            }
        }
        
        $identifier = $rootClass->getSingleIdentifierFieldName();
        
        if (isset($rootClass->associationMappings[$identifier])) {
            throw new \RuntimeException("Paginating an entity with foreign key as identifier only works when using the Output Walkers. Call Paginator#setUseOutputWalkers(true) before iterating the paginator.");
        }

        $this->_getQuery()->setHint(
            self::IDENTIFIER_TYPE,
            Type::getType($rootClass->getTypeOfField($identifier))
        );

        $pathExpression = new PathExpression(
            PathExpression::TYPE_STATE_FIELD | PathExpression::TYPE_SINGLE_VALUED_ASSOCIATION,
            $rootAlias,
            $identifier
        );
        $pathExpression->type = PathExpression::TYPE_STATE_FIELD;

        array_unshift($selectExpressions, new SelectExpression($pathExpression, '_dctrn_id'));
        $AST->selectClause->selectExpressions = $selectExpressions;

        if (isset($AST->orderByClause)) {
            foreach ($AST->orderByClause->orderByItems as $item) {
                if ( ! $item->expression instanceof PathExpression) {
                    continue;
                }
                
                $AST->selectClause->selectExpressions[] = new SelectExpression(
                    $this->createSelectExpressionItem($item->expression),
                    '_dctrn_ord' . $this->_aliasCounter++
                );
            }
        }

        $AST->selectClause->isDistinct = true;
    }
320940
protected function createValidatorInstanceFromAnnotation($validatorAnnotation)
    {
        return ValidatorBuilder::builder()
            ->withSpecification($validatorAnnotation->getValue())
            ->withClass($validatorAnnotation->getAssociatedClass())
            ->build();
    }
705577
public function select($fields = null, $where = null, $orderBy = null, $limit = null): Statement
    {
        $this->operation = 'select';
        return $this->setSelectArgument($fields, $where, $orderBy, $limit);
    }
1280148
function Select($distinct, SelectList $selectList, Source $source, Condition $condition = null, OrderList $orderList = null, GroupList $groupList = null, $offset = 0, $count = 0)
    {
        return parent::CreateSelect($distinct, $selectList, $source, $condition, $orderList, $groupList, $offset, $count); 
    }
1190604
public function union(SelectQuery $query)
    {
        $instance = $this->selectQueryInstance();

        $instance->selectQuery()->union($query);

        return $instance;
    }
561298
protected function evaluateMatcher()
    {
        if ($this->isEvaluated) {
            return;
        }
        $context = new EelContext($this->getConditionGenerator());

        /** @var EntityPrivilegeExpressionEvaluator $evaluator */
        $evaluator = $this->objectManager->get(EntityPrivilegeExpressionEvaluator::class);
        $result = $evaluator->evaluate($this->getParsedMatcher(), $context);
        $this->entityType = $result['entityType'];
        $this->conditionGenerator = $result['conditionGenerator'] !== null ? $result['conditionGenerator'] : new TrueConditionGenerator();
        $this->isEvaluated = true;
    }
1232397
public function setOptionValidator(\JBBCode\InputValidator $validator, $option=null)
    {
        if (empty($option)) {
            $option = $this->tagName;
        }
        $this->optionValidator[$option] = $validator;
        return $this;
    }
1131436
public function select($statements)
    {
        if (!array_key_exists('tables', $statements)) {
            throw new Exception('No table specified.', 3);
        } elseif (!array_key_exists('selects', $statements)) {
            $statements['selects'][] = '*';
        }

        // From
        $tables = $this->arrayStr($statements['tables'], ', ');
        // Select
        $selects = $this->arrayStr($statements['selects'], ', ');


        // Wheres
        list($whereCriteria, $whereBindings) = $this->buildCriteriaWithType($statements, 'wheres', 'WHERE');
        // Group bys
        $groupBys = '';
        if (isset($statements['groupBys']) && $groupBys = $this->arrayStr($statements['groupBys'], ', ')) {
            $groupBys = 'GROUP BY ' . $groupBys;
        }

        // Order bys
        $orderBys = '';
        if (isset($statements['orderBys']) && is_array($statements['orderBys'])) {
            foreach ($statements['orderBys'] as $orderBy) {
                $orderBys .= $this->wrapSanitizer($orderBy['field']) . ' ' . $orderBy['type'] . ', ';
            }

            if ($orderBys = trim($orderBys, ', ')) {
                $orderBys = 'ORDER BY ' . $orderBys;
            }
        }

        // Limit and offset
        $limit = isset($statements['limit']) ? 'LIMIT ' . $statements['limit'] : '';
        $offset = isset($statements['offset']) ? 'OFFSET ' . $statements['offset'] : '';

        // Having
        list($havingCriteria, $havingBindings) = $this->buildCriteriaWithType($statements, 'havings', 'HAVING');

        // Joins
        $joinString = $this->buildJoin($statements);

        $sqlArray = array(
            'SELECT' . (isset($statements['distinct']) ? ' DISTINCT' : ''),
            $selects,
            'FROM',
            $tables,
            $joinString,
            $whereCriteria,
            $groupBys,
            $havingCriteria,
            $orderBys,
            $limit,
            $offset
        );

        $sql = $this->concatenateQuery($sqlArray);

        $bindings = array_merge(
            $whereBindings,
            $havingBindings
        );

        return compact('sql', 'bindings');
    }
751403
public function createListFromChoices($choices, $value = null)
    {
        if (\is_string($value)) {
            $value = new PropertyPath($value);
        }

        if ($value instanceof PropertyPath) {
            $accessor = $this->propertyAccessor;
            $value = function ($choice) use ($accessor, $value) {
                // The callable may be invoked with a non-object/array value
                // when such values are passed to
                // ChoiceListInterface::getValuesForChoices(). Handle this case
                // so that the call to getValue() doesn't break.
                if (\is_object($choice) || \is_array($choice)) {
                    return $accessor->getValue($choice, $value);
                }
            };
        }

        return $this->decoratedFactory->createListFromChoices($choices, $value);
    }
8005
public function walkSelectStatement(SelectStatement $AST)
    {
        if ($this->platformSupportsRowNumber()) {
            return $this->walkSelectStatementWithRowNumber($AST);
        }

        return $this->walkSelectStatementWithoutRowNumber($AST);
    }
1034301
private function deserializeSelections(SelectionQuestion $selectionQuestion, array $selections, array $solutions, array $options = [])
    {
        $selectionEntities = $selectionQuestion->getSelections()->toArray();

        foreach ($selections as $selectionData) {
            $selection = null;

            foreach ($selectionEntities as $entityIndex => $selectionEntity) {
                /** @var Selection $selectionEntity */
                if ($selectionEntity->getUuid() === $selectionData['id']) {
                    $selection = $selectionEntity;
                    unset($selectionEntities[$entityIndex]);
                    break;
                }
            }

            $selection = $selection ?: new Selection();
            $selection->setUuid($selectionData['id']);

            $solutionsD = array_values(array_filter($solutions, function ($solution) use ($selectionData) {
                return $solution['selectionId'] === $selectionData['id'];
            }));

            if (isset($solutionsD[0]) && isset($solutionsD[0]['feedback'])) {
                $selection->setFeedback($solutionsD[0]['feedback']);
            }

            $selection->setBegin($selectionData['begin']);
            $selection->setEnd($selectionData['end']);

            foreach ($solutions as $solutionData) {
                if ($solutionData['selectionId'] === $selectionData['id']) {
                    switch ($options['selection_mode']) {
                      case SelectionQuestion::MODE_SELECT:
                        $selection->setScore($solutionData['score']);
                        break;
                      case SelectionQuestion::MODE_HIGHLIGHT:
                        $selection->setScore(0);
                        $this->deserializeColorSelection($selection, $solutionData['answers'], $selectionQuestion->getColors()->toArray());
                        break;
                      }
                }
            }

            $selectionQuestion->addSelection($selection);
        }

        // Remaining color are no longer in the Question
        foreach ($selectionEntities as $selectionToRemove) {
            $selectionQuestion->removeSelection($selectionToRemove);
        }
    }
808271
public function walkSelectStatement(SelectStatement $AST)
    {
        if ($AST->havingClause) {
            throw new \RuntimeException('Cannot count query that uses a HAVING clause. Use the output walkers for pagination');
        }

        $queryComponents = $this->_getQueryComponents();
        // Get the root entity and alias from the AST fromClause
        $from = $AST->fromClause->identificationVariableDeclarations;
        
        if (count($from) > 1) {
            throw new \RuntimeException("Cannot count query which selects two FROM components, cannot make distinction");
        }
       
        $fromRoot            = reset($from);
        $rootAlias           = $fromRoot->rangeVariableDeclaration->aliasIdentificationVariable;
        $rootClass           = $queryComponents[$rootAlias]['metadata'];
        $identifierFieldName = $rootClass->getSingleIdentifierFieldName();

        $pathType = PathExpression::TYPE_STATE_FIELD;
        if (isset($rootClass->associationMappings[$identifierFieldName])) {
            $pathType = PathExpression::TYPE_SINGLE_VALUED_ASSOCIATION;
        }

        $pathExpression = new PathExpression(
            PathExpression::TYPE_STATE_FIELD | PathExpression::TYPE_SINGLE_VALUED_ASSOCIATION, $rootAlias,
            $identifierFieldName
        );
        $pathExpression->type = $pathType;

        $distinct = $this->_getQuery()->getHint(self::HINT_DISTINCT);
        $AST->selectClause->selectExpressions = array(
            new SelectExpression(
                new AggregateExpression('count', $pathExpression, $distinct), null
            )
        );

        // ORDER BY is not needed, only increases query execution through unnecessary sorting.
        $AST->orderByClause = null;
    }
820477
public function select($table = null, $selectFields = array('*'))
    {
    	$this->queryTypeProcess(self::QUERYTYPE_SELECT, $table, $selectFields);
        return $this;
    }
788510
public function applyFilterSelect(Filter\FilterSelect $filter)
	{
		foreach ($filter->getCondition() as $column => $value) {
			$expr = Criteria::expr()->eq($column, $value);
			$this->criteria->andWhere($expr);
		}
	}
787809
public static Elements select(Evaluator evaluator, Element root) {
        Validate.notNull(evaluator);
        Validate.notNull(root);
        return Collector.collect(evaluator, root);
    }