Calls the modifyRequestType methods to modify query just before execution
@return $this
331719
private function modify()
    {
        if ($this->isIndex()) {
            $this->query = $this->modifyIndex($this->query);
        }
        else if ($this->isShow()) {
            $this->query = $this->modifyShow($this->query);
        }
        else if ($this->isDelete()) {
            $this->query = $this->modifyDelete($this->query);
        }
        else if ($this->isUpdate()) {
            $this->query = $this->modifyUpdate($this->query);
        }

        return $this;
    }
1247483
protected function BeforeGather()
    {  
        if ($this->IsTriggered() && $this->Elements()->Check(Request::MethodArray($this->Method())))
        {
            return $this->OnSuccess();
        }
        return parent::BeforeGather();
    }
482273
private function modify()
	{
		// Add any automatic fields
		$this->parseAutomatics('renew');
		$data = $this->getTableColumnsOnly();
		// Return the result of the query
		return $this->query->alter(
			$this->getTableName(),
			$this->getPrimaryKey(),
			$this->getPkValue(),
			$data
		);
	}
106636
public function modifyTable()
    {
        $table = $this->getTable();

        if (!$table->containsColumn($this->getParameter('rank_column'))) {
            $table->addColumn(array(
                'name' => $this->getParameter('rank_column'),
                'type' => 'INTEGER'
            ));
        }
        if ($this->useScope() && !$this->hasMultipleScopes() &&
             !$table->containsColumn($this->getParameter('scope_column'))) {
            $table->addColumn(array(
                'name' => $this->getParameter('scope_column'),
                'type' => 'INTEGER'
            ));
        }

        if ($this->useScope()) {
            $scopes = $this->getScopes();
            if (0 === count($scopes)) {
                throw new \InvalidArgumentException(sprintf(
                    'The sortable behavior in `%s` needs a `scope_column` parameter.',
                    $this->getTable()->getName()
                ));
            }
            foreach ($scopes as $scope) {
                $keys = $table->getColumnForeignKeys($scope);
                foreach ($keys as $key) {
                    if ($key->isForeignPrimaryKey() && $key->getOnDelete() == ForeignKey::SETNULL) {
                        $foreignTable = $key->getForeignTable();
                        $relationBehavior = new SortableRelationBehavior();
                        $relationBehavior->addParameter(array('name' => 'foreign_table', 'value' => $table->getName()));
                        $relationBehavior->addParameter(array('name' => 'foreign_scope_column', 'value' => $scope));
                        $relationBehavior->addParameter(array('name' => 'foreign_rank_column', 'value' => $this->getParameter('rank_column')));
                        $foreignTable->addBehavior($relationBehavior);
                    }
                }
            }
        }
    }
1013663
private function setLimit()
    {
        if (isset($this->requestParams['start']) && -1 != $this->requestParams['length']) {
            $this->qb->setFirstResult($this->requestParams['start'])->setMaxResults($this->requestParams['length']);
        }

        return $this;
    }
1227558
public function prepareRequest()
    {
        $version = $this->versionEngine->getVersion();
        $queryConfiguration = $version->parseRequest($this->columnConfigurations);
        $this->provider->prepareForProcessing($queryConfiguration, $this->columnConfigurations);

        return [
            'version' => $version,
            'queryConfiguration' => $queryConfiguration
        ];
    }
1148686
public function modifyDatabase()
    {
        foreach ($this->getDatabase()->getTables() as $table) {
            if (!$table->hasPrimaryKey()) {
                $b = clone $this;
                $table->addBehavior($b);
            }
        }
    }
997014
public function handleRequest()
    {
        $request = $this->prepareRequest();
        $version = $request['version'];
        $queryConfiguration = $request['queryConfiguration'];

        $data = $this->provider->process();
        return $version->createResponse($data, $queryConfiguration, $this->columnConfigurations);
    }
1043636
protected function beforeRequest()
    {
        if ($this->recreateApplication) {
            $this->resetApplication();
            return;
        }

        $application = $this->getApplication();

        $this->resetResponse($application);
        $this->resetRequest($application);

        $definitions = $application->getComponents(true);
        foreach ($this->recreateComponents as $component) {
            // Only recreate if it has actually been instantiated.
            if ($application->has($component, true)) {
                $application->set($component, $definitions[$component]);
            }
        }
    }
280908
private function overrideOriginalRestApiRequest()
    {
        $_GET = $this->restApiGetData;
        $_POST = $this->restApiPostData;
        $_SERVER['REQUEST_METHOD'] = $this->restApiRequestMethod;
        $_SERVER['REQUEST_URI'] = $this->restApiRequestUri;

        if ($this->restApiRequestMethod !== 'POST' && $this->restApiRequestMethod !== 'PUT') {
            // content-type and content-length should only exist when request-method is
            // POST or PUT (because in this case there can be the request-data in the body)
            if (array_key_exists('CONTENT_TYPE', $_SERVER)) {
                unset($_SERVER['CONTENT_TYPE']);
            }
            if (array_key_exists('HTTP_CONTENT_TYPE', $_SERVER)) {
                unset($_SERVER['HTTP_CONTENT_TYPE']);
            }
            if (array_key_exists('CONTENT_LENGTH', $_SERVER)) {
                unset($_SERVER['CONTENT_LENGTH']);
            }
        }

        $this->restApiRequestScope->overrideOriginalRestApiRequest($this);
        $this->restApiRequestScope->removeRestApiAuthenticationObjects();

        /**
         * add all authentication-classes:
         *  - we must add all authentication-classes, because the authentication-classes are stored in this object
         *  - we don't must add all REST-API-classes, because the REST-API-classes are not stored in this object
         */
        $this->authClasses = $this->restApiRequestScope->getOriginalRestApiRequest()->_authClasses;
    }
13579
public function updateModifyQuery($modify)
    {
        if ($this->relation) {
            $modify = $this->relation->dsql;
        }

        $modify->set(
            $this->actual_field ?: $this->short_name,
            $this->getSQL()
        );

        return $this;
    }
148481
public function modifyQuery(Query $query)
    {
        return $this->queryBuilder->startFrom($query)->useDebug(true)->getQuery();
    }
569293
protected function setRequestQueryString()
    {
        $query = $this->request->getQuery();

        foreach ($this->queryStrings as $key => $value) {
            $query->set($key, $value);
        }
    }
490124
public function modify(RequestInterface $request) : RequestInterface
    {
        /** @var RequestModifierInterface $modifier */
        foreach ($this->collection as $modifier) {
            $request = $modifier->modify($request);
        }

        return $request;
    }
1079191
public static function modifyQuery($uri, array $newQueryParams)
    {
        if ($uri === null) {
            $uri = static::getCurrentRequestUri();
        }

        $query = parse_url($uri, PHP_URL_QUERY);

        $queryParams = [];
        parse_str($query, $queryParams);

        $newQuery = http_build_query(array_merge($queryParams, $newQueryParams));

        $fragment = parse_url($uri, PHP_URL_FRAGMENT);
        return parse_url($uri, PHP_URL_PATH)
        . ($newQuery ? '?' . $newQuery : '')
        . ($fragment ? '#' . $fragment : '');
    }
103035
public function save()
    {
        if (true === $this->modified) {
            if (null !== $this->uid) {
                $this->update($this->parameters());
            } else {
                $this->insert($this->parameters());
            }
        }

        return $this;
    }
767080
public function modify()
    {
        $date   = $this->getParameter('value');
        $modify = (string) $this->getParameter('modify');
        $format = (string) $this->getParameter('format');

        if (empty($date))
            $date = 'now';

        if ($date instanceof Meta)
            $date = $date->MetaValue;

        if (!$date instanceof Date) {
            try {
                $date = $this->DateFactory->newLocalDate($date);
            } catch(DateException $e) {
                $date = $this->DateFactory->newLocalDate('now');
            }
        }

        $date = $this->DateFactory->toLocalDate($date);
        if (!empty($modify)) {
            try {
                $date->modify($modify);
            } catch (Exception $e) {
                return '';
            }
        }

        return $date->format($format);
    }