return a new Query param
@param string $className
@param array $options
@return \oat\search\factory\QueryCriterionInterface
@throws \InvalidArgumentException
519274
public function get($className,array $options = array()) {
        $Param = $this->getServiceLocator()->get($className);
        if($this->isValidClass($Param)) {
            
            $Param->setName($options[0])
                ->setOperator($options[1])
                ->setValue($options[2])
                ->setServiceLocator($this->getServiceLocator());
            
            return $Param;
        }
        
    }
683843
public function asObject(string $className, array $constructorArgs = []): QueryBuilderHandler
    {
        return $this->setFetchMode(PDO::FETCH_CLASS, $className, $constructorArgs);
    }
1066631
public static function findAll(string $className, array $condition = [], array $options = [])
    {
        $instance = self::getInstance($className);
        $query    = Query::table($className)->className($className)->selectInstance($instance);

        if (!empty($condition)) {
            $query = $query->condition($condition);
        }

        $query  = self::applyOptions($query, $options);
        $fields = self::getFieldsFromOptions($options);

        return $query->get($fields);
    }
383159
public function get($name, array $options = array())
    {
        $name = strtolower((string) $name);

        if (!$this->has($name)) {
            throw new InvalidArgumentException(sprintf('Unrecognized compressor "%s"', $name));
        }

        $mapping = $this->getMapping();
        $className = $mapping[$name];

        if ($options === array()) {
            return new $className();
        }

        $reflection = new \ReflectionClass($className);
        return $reflection->newInstanceArgs($options);
    }
93361
public function make($classname, ...$args)
    {
        $resource = $this->resolve($classname);
        return $resource->make(...$args);
    }
226173
private function generateQueryString($options)
    {
        //query parameters
        $queryStringParams = array();
        if (isset($options[self::OSS_QUERY_STRING])) {
            $queryStringParams = array_merge($queryStringParams, $options[self::OSS_QUERY_STRING]);
        }
        return OssUtil::toQueryString($queryStringParams);
    }
435254
public function search(\Cake\ORM\Query $query, $options = [])
    {
        $_query = $this->Controller->request->query;
        $this->Controller->request->data = $_query;

        $params = $_query;
        $filters = $this->_normalize($this->config('filters'));

        foreach ($filters as $field => $options) {
            $hash = Hash::get($params, $options['column']);
            if (!empty($hash)) {
                $key = $this->_buildKey($field, $options);
                $value = $this->_buildValue($field, $options, $params);

                $query->where([$key => $value]);

                $this->_setValue($field, $options, $params);
            }
        }

        return $query;
    }
653361
public function getColumnObject($options)
    {
        $class = $this->getColumnClassName($options);

        return new $class($this->validator, $this->config, $this->db, $options);
    }
953926
private function generateQueryOptions(array $options = [])
    {
        if (isset($options['query'])) {
            $result = $options['query'] + $this->getDefaultOptions();
        } else {
            $result['query'] = $options + $this->getDefaultOptions();
        }

        return $result;
    }
833733
private function getQuery(array $where, array $options): MongoQuery
    {
        try {
            $query = new MongoQuery($where, $options);
        } catch (InvalidArgumentException $e) {
            new Exception('WriteConcern could not to be initiated');
        }
        return $query;
    }
494587
public static function findByIds($className, array $ids, array $options): ResultInterface
    {
        list($tableName, , $columnId) = self::getTable($className);
        $instance = self::getInstance($className);

        $query  = Query::table($tableName)->className($className)->whereIn($columnId, $ids)->selectInstance($instance);
        $query  = self::applyOptions($query, $options);
        $fields = self::getFieldsFromOptions($options);

        return $query->get($fields);
    }
1311276
public function buildQuery(ReadOptionsInterface $readOptions): ORM\QueryBuilder
    {
        $options = $readOptions->toArray();
        $builder = $this->entityManager->createQueryBuilder();

        if (!array_key_exists(ReadOptions::FIELD, $options)) {
            $options[ReadOptions::FIELD] = [];
        }
        if (array_key_exists(ReadOptions::SLUG, $options)) {
            $options[ReadOptions::FIELD]['slug'] = $options[ReadOptions::SLUG];
        }

        $fields = array_merge(
            explode(',', $options[ReadOptions::FETCH_FIELDS]),
            ...array_map(
                function (string $queryField): array {
                    return static::tail(explode(':', $queryField));
                },
                array_merge(
                    array_keys($options[ReadOptions::FIELD]),
                    array_key_exists(ReadOptions::ORDER_BY, $options) ?
                        array_keys($options[ReadOptions::ORDER_BY]) : []
                )
            )
        );
        $fields = array_unique($fields);
        if ($fields === ['']) {
            throw new InvalidFetchFieldsQueryException("Not selecting any fields");
        }

        // The root entity is the basic section we join everything else to and start all lookups on.
        $root = $options[ReadOptions::SECTION];
        $builder->from($root, static::simplifyClass($root));

        /*
         * We build a queue of fields to select and tables to join.
         * Each member of the queue is a chain of items with a 'field' key and a 'class' key.
         * This chain describes how to look the field up on the root entity.
         * The 'field' is the name of the field on the previous entity in the chain, and the 'class' is the class of
         * the current entity in the chain.
         */
        $queue = [[['field' => static::simplifyClass($root), 'class' => $root]]];
        $didSelect = false;
        while ($queue) {
            $entityPath = array_shift($queue);
            if (count($entityPath) > 5 || static::hasDuplicates($entityPath)) {
                continue;
            }

            $pathEnd = static::end($entityPath);
            /** @var CommonSectionInterface|string $class */
            $class = $pathEnd['class'];
            $fieldName = $pathEnd['field'];

            $classMetadata = $class::fieldInfo();
            $name = static::implodeEntityPath($entityPath);

            if (count($entityPath) > 1) {
                // Because this is not the root entity, add a join
                $parentName = static::implodeEntityPath(static::tail($entityPath));
                $builder->leftJoin("$parentName.$fieldName", $name);
            }
            foreach ($fields as $field) {
                if ($field === 'slug') {
                    $field = static::findSlug($classMetadata);
                }
                if (array_key_exists($field, $classMetadata)) {
                    $fieldInfo = $classMetadata[$field];
                    if (is_null($fieldInfo['relationship'])) {
                        $didSelect = true;
                        $builder->addSelect("{$name}.{$field} AS {$name}:{$field}");
                    } else {
                        // This field points to a related entity, so add another join to the queue
                        $newEntityPath = $entityPath;
                        $newEntityPath[] = [
                            'field' => $field,
                            'class' => $fieldInfo['relationship']['class']
                        ];
                        $queue[] = $newEntityPath;
                    }
                }
            }
        }

        if (!$didSelect) {
            throw new InvalidFetchFieldsQueryException("Could not find any of the fields");
        }

        $wheres = [];
        $num = 1;
        foreach ($options[ReadOptions::FIELD] as $field => $value) {
            $fieldParts = array_merge(
                [static::simplifyClass($root)],
                explode(':', $field)
            );
            if (static::end($fieldParts) === 'slug') {
                // The slug field is actually called something like "entitySlug", not "slug", but we'd like to
                // support it this way as well.
                // This is only a guess, because tracking the correct class is hard. It won't work if
                // the field name doesn't match the class name. In that case, just use the full slug field name.
                $fieldParts[count($fieldParts) - 1] = $fieldParts[count($fieldParts) - 2] . 'Slug';
            }
            $lookupEntity = implode(':', static::tail($fieldParts));
            $fieldName = static::end($fieldParts);
            $fieldPath = "$lookupEntity.$fieldName";
            if (is_array($value)) {
                $wheres[] = "$fieldPath IN (?$num)";
            } else {
                $wheres[] = "$fieldPath = (?$num)";
            }
            $builder->setParameter($num, $value);
            $num += 1;
        }
        if (count($wheres) > 0) {
            $builder->where($builder->expr()->andX(...$wheres));
        }

        if (array_key_exists(ReadOptions::LIMIT, $options)) {
            $builder->setMaxResults($options[ReadOptions::LIMIT]);
        }

        if (array_key_exists(ReadOptions::ORDER_BY, $options)) {
            $builder->orderBy(
                static::simplifyClass($root) . ':' . key($options[ReadOptions::ORDER_BY]),
                current($options[ReadOptions::ORDER_BY])
            );
        }
        return $builder;
    }
1172535
public function setQueryClass($className)
    {
        if ($this->queryClass !== $className && !$this->isQueryOrScan()) {
            throw ODMException::queryOperationAlreadySet($this->queryClass);
        }

        $this->queryClass = $className;

        return $this;
    }
1196875
public static function query($options = array())
	{
		$timestamp_start_name = static::temporal_property('start_column');
		$timestamp_end_name = static::temporal_property('end_column');
		$max_timestamp = static::temporal_property('max_timestamp');

		$query = Query_Temporal::forge(get_called_class(), static::connection(), $options)
			->set_temporal_properties($max_timestamp, $timestamp_end_name, $timestamp_start_name);

		//Check if we need to add filtering
		$class = get_called_class();
		$timestamp = \Arr::get(static::$_lazy_filtered_classes, $class, null);

		if( ! is_null($timestamp))
		{
			$query->where($timestamp_start_name, '<=', $timestamp)
				->where($timestamp_end_name, '>', $timestamp);
		}
		elseif(static::get_primary_key_status() and ! static::get_primary_key_id_only_status())
		{
			$query->where($timestamp_end_name, $max_timestamp);
		}

		return $query;
	}
1128498
public static function create(array $tokens, array $options = []) {
        HashMap::assert($tokens, 'tokens');

        $operation = SqlOperation::create($tokens);
        if ($operation !== SqlOperations::SELECT) return null;

        $query = implode('&', array_filter([
            self::createConditionals($tokens),
            self::createPagination($tokens, $options),
        ]));

        return $query;
    }
981333
protected function getInstance($classname, $params)
    {
        $components = UIComponentsRegistry::get('ui-components');
        if (is_null($components)) {
            return false;
        }
        $object = $components->first(function ($value, $key) use($classname) {
            return $value instanceof $classname;
        });
        if (!$object) {
            return false;
        }

        $attributes       = array_only(array_get($params, 'data'), ['x', 'y', 'width', 'height', 'disabled', 'id']);
        $attributes['id'] = isset($params['id']) ? $params['id'] : null;

        $object->setAttributes($attributes);
        return $object;
    }
1314331
public function createTracking($className, $options = null)
    {
        if (strstr(strtolower($className), 'abstracttracking')) {
            return false;
        }

        $class = 'Racecore\GATracking\Tracking\\' . $className;
        if ($options) {
            return new $class($options);
        }
        return new $class;
    }