@param string      $name
@param string|null $on_conflict
@param string|null $conflict_target

@return $this
@throws \chillerlan\Database\Query\QueryException
169621
public function name(string $name, string $on_conflict = null, string $conflict_target = null){
		$this->name      = trim($name);
		$on_conflict     = trim(strtoupper($on_conflict));
		$conflict_target = trim(strtoupper($conflict_target));

		if(empty($this->name)){
			throw new QueryException('no name specified');
		}

		if(!empty($on_conflict)){
			$this->on_conflict = $on_conflict;
		}

		if(!empty($conflict_target)){
			$this->conflict_target = $conflict_target;
		}

		return $this;
	}
859498
private function lazyLoad($query_name)
    {
        if (isset($this->query_handler_ids[$query_name])) {
            list($service, $method) = $this->query_handler_ids[$query_name];

            return $this->resolve($this->container->get($service), $method);
        }

        return null;
    }
70512
public function getQuery($name = null, $defaultValue = null, $notAllowEmpty = false)
    {
        if (!is_null($name)) {
            if (isset($this->getQueryParams()[$name])) {
                if (empty($this->getQueryParams()[$name]) && $notAllowEmpty) {
                    return $defaultValue;
                }

                return $this->getQueryParams()[$name];
            }

            return $defaultValue;
        }

        return $this->getQueryParams();
    }
138734
protected function subfieldConflicts(
        array $conflicts,
        string $responseName,
        FieldNode $nodeA,
        FieldNode $nodeB
    ): ?Conflict {
        if (empty($conflicts)) {
            return null;
        }

        return new Conflict(
            $responseName,
            array_map(function (Conflict $conflict) {
                return [$conflict->getResponseName(), $conflict->getReason()];
            }, $conflicts),
            array_reduce($conflicts, function ($allFields, Conflict $conflict) {
                return array_merge($allFields, $conflict->getFieldsA());
            }, [$nodeA]),
            array_reduce($conflicts, function ($allFields, Conflict $conflict) {
                return array_merge($allFields, $conflict->getFieldsB());
            }, [$nodeB])
        );
    }
851301
public static function create($modelAlias = null, $criteria = null)
    {
        if ($criteria instanceof RemoteAppQuery) {
            return $criteria;
        }
        $query = new RemoteAppQuery(null, null, $modelAlias);

        if ($criteria instanceof Criteria) {
            $query->mergeWith($criteria);
        }

        return $query;
    }
88460
public function apply($dbDriver, $alias, $field, $exprValue, $namedParameter = null, &$value = null)
	{
		if (!preg_match(self::PATTERN, $exprValue)) {
			throw new BadQueryExprException(sprintf('The query expression converter "isNull" does not support the following pattern "%s".', $exprValue));
		}
		$value = null;
		
		return (new \Doctrine\ORM\Query\Expr())->isNull($alias.'.'.$field);
	}
385139
public function addResource(ResourceInterface $resource, $name = null) {
		if ($name === null) {
			$this->resources[] = $resource;
			
			return $this;
		}
		
		$this->resources[$name] = $resource;
		
		return $this;
	}
1247536
protected function findConflictResolutions()
    {
        $contents = '<?php' . PHP_EOL . $this->declaringClass->getBody();
        $this->tokens = token_get_all($contents);
        $this->tokensCount = count($this->tokens);

        while (($token = $this->next()) !== null) {
            if ($token[0] === T_USE) {
                $conflicts = $this->extractConflictsFromUseStatement();
                if ($conflicts !== null) {
                    $this->conflictResolutions = explode(';', implode('', $conflicts));
                    $this->conflictResolutions = array_map('trim', $this->conflictResolutions);
                    $this->conflictResolutions = array_filter($this->conflictResolutions);

                    return;
                }
            }
        }

        throw new InvalidArgumentException('Could not find the trait "' . $this->name . '".');
    }
123447
func (me *DefaultAdapter) OnConflictSql(buf *SqlBuilder, o ConflictExpression) error {
	if o == nil {
		return nil
	}
	buf.Write(me.ConflictFragment)
	if u := o.Updates(); u != nil {
		target := u.Target
		if me.SupportsConflictTarget() && target != "" {
			buf.Write([]byte(" ("))
			buf.Write([]byte(target))
			buf.Write([]byte(")"))
		}
		if err := me.onConflictDoUpdateSql(buf, *u); err != nil {
			return err
		}
	} else {
		buf.Write(me.ConflictDoNothingFragment)
	}
	return nil
}
491079
public function query($name, $class, $resolver = null)
    {
        /**
         * @var QueryScaffolder $query
        */
        $query = $this->queries->findByName($name);
        if ($query) {
            return $query;
        }

        $operationScaffold = (new ListQueryScaffolder($name, null, $resolver, $class))
            ->setChainableParent($this);

        $this->queries->push($operationScaffold);

        return $operationScaffold;
    }
993586
public function apply($name, $value, $query, FilterInterface $filter)
    {
        $column = ( ! empty($this->table) ? $this->table . '.' : null)
                . ( ! empty($this->column) ? $this->column : $name);

        return $query->where(function ($query) use ($column) {
            
            return $query->whereNull($column)
                         ->orWhere($column, '');
        });
    }
128418
private function hasNameConflict(NodeInterface $parentNode, $name, NodeInterface $forNode = null)
    {
        return $parentNode->hasNode($name) && (!$forNode || $parentNode->getNode($name) !== $forNode);
    }
314857
public function withoutParam(string $param_name): ParamHolderInterface
    {
        if (!$this->has($param_name)) {
            return $this;
        }
        $param_holder = clone $this;
        unset($param_holder->params[$param_name]);
        return $param_holder;
    }
449088
public function overrideAsSingleton($name, $resolver = null)
    {
        return $this->singleton($name, $resolver, true, true);
    }
8875
static public function getCommon($name = null, $default=null)
    {
        $value = self::get($name, self::$range);
        return $value === null ? $default : $value;
    }
1366426
private function action($action_name) {
    	// if no principal action is set yet or is the same
		if(!$this->Action || $action_name == $this->Action) {
			// set the main action
			$this->Action = $action_name;
		}
		// an action has already been set, this is impossible
		else { Throw new Exception("Query->action({$action_name}) : An incompatible action already exists : {$this->Action}"); }
    }
1350922
public function query($name = null, $default = null)
    {
        if ($name) {
            return $this->request->query->get($name, $default);
        }

        return $this->request->query->all();
    }