Handle metabox initialization.
Set the metabox fields value and return the metabox instance.

@param MetaboxInterface $metabox
@param Request          $request

@return MetaboxInterface
328922
public function getFields(MetaboxInterface $metabox, Request $request): MetaboxInterface
    {
        foreach ($metabox->repository()->all() as $field) {
            if (method_exists($field, 'metaboxGet')) {
                $field->metaboxGet($request->query('post_id'));
            }
        }

        return $metabox;
    }
1371934
private function createRequest(RequestInterface $request)
    {
        $options = [
            'exceptions' => false,
            'allow_redirects' => false,
        ];

        $options['version'] = $request->getProtocolVersion();
        $options['headers'] = $request->getHeaders();
        $body = (string) $request->getBody();
        $options['body'] = '' === $body ? null : $body;

        return $this->client->createRequest(
            $request->getMethod(),
            (string) $request->getUri(),
            $options
        );
    }
152456
private function setRequest(Request $request)
    {
        $this->mergeVisitorActivityData([
            'method'      => $request->method(),
            'is_ajax'     => $request->ajax(),
            'is_secure'   => $request->isSecure(),
            'is_json'     => $request->isJson(),
            'wants_json'  => $request->wantsJson(),
        ]);

        $this->request = $request;

        return $this;
    }
65886
public function renameAction(Request $request)
    {
        $id = $request->get('id');
        $name = $request->get('name');

        $metaSetManager = $this->get('phlexible_meta_set.meta_set_manager');

        if ($metaSetManager->findOneByName($name)) {
            return new ResultResponse(false, 'Name already in use.');
        }

        $metaSet = $metaSetManager->find($id);
        $oldName = $metaSet->getName();

        $metaSet->setName($name);
        $metaSetManager->updateMetaSet($metaSet);

        return new ResultResponse(true, "Meta Set $oldName renamed to $name.");
    }
663536
public function execute(RequestInterface $request): RequestInterface
    {
        if (is_null($this->sessionToken)) {
            return $request;
        } else {
            return $request->withHeader(
                self::HEADER_CLIENT_AUTHENTICATION,
                [$this->sessionToken->getToken()]
            );
        }
    }
571090
public function init($request)
    {
        $oGenerator = oxNew(\OxidEsales\Eshop\Core\DbMetaDataHandler::class);
        $oGenerator->updateViews();
    }
791523
public function fieldsAction(Request $request)
    {
        $id = $request->get('id');

        $metaSetManager = $this->get('phlexible_meta_set.meta_set_manager');
        $metaSet = $metaSetManager->find($id);
        $fields = $metaSet->getFields();

        $data = [];
        foreach ($fields as $field) {
            $data[] = [
                'id' => $field->getId(),
                'key' => $field->getName(),
                'type' => $field->getType(),
                'required' => $field->isRequired(),
                'synchronized' => $field->isSynchronized(),
                'readonly' => $field->isReadonly(),
                'options' => $field->getOptions(),
            ];
        }

        return new JsonResponse(['values' => $data]);
    }
378221
public function create(ModelInterface $model, $belongsTo)
    {
        $metabox = $this->container->make(MetaboxSingularity::class);

        $metabox
            ->setModel($model)
            ->setBelongsTo($belongsTo)
            ->boot();

        return $metabox;
    }
1151055
protected function configureRequest(RequestInterface $Request)
    {
        if ($Request->getStatus() >= Curl::STATUS_SENT){
            $Request->reset();
        }
        if (isset($this->properties[self::PROPERTY_HTTP_METHOD]) &&
            $this->properties[self::PROPERTY_HTTP_METHOD] !== ''){
            $Request->setMethod($this->properties[self::PROPERTY_HTTP_METHOD]);
        }
        $url = $this->configureURL($this->getOptions());
        if ($this->verifyUrl($url)) {
            $url = rtrim($this->getBaseUrl(),"/")."/".$url;
            $Request->setURL($url);
        }
        $data = ($this->getData()?$this->getData():NULL);
        $data = $this->configureData($data);
        $Request->setBody($data);
        if ($this->authRequired()){
            if (isset($this->Auth)){
                $this->Auth->configureRequest($Request);
            }
        }
        return $Request;
    }
405419
public function initialize($request)
    {
        $this->_inputStream  = new Zend_Amf_Parse_InputStream($request);
        $this->_deserializer = new Zend_Amf_Parse_Amf0_Deserializer($this->_inputStream);
        $this->readMessage($this->_inputStream);
        return $this;
    }
1269822
public function initializeRequest($request = null)
	{
		if (empty($request)) {
			$this->request = Request::createFromGlobals();
		} else {
			$this->request = $request;
		}

		// Shortcuts to the request object for cleaner syntax.
		$this->input = new Input($this->request);
	}
642465
protected function handleRequest(RequestInterface $request): RequestInterface
    {
        if ($request instanceof JsonApiRequest) {
            $document = $request->getDocument();
            $stream   = $this->documentToStream($document);

            return $request->withBody($stream);
        }

        return $request;
    }
1108249
public function setRequest(Request $request)
    {
        $this->request = $request;
        $this->context->registerInstance($request);
    }
371685
public function onRequest( RequestInterface $request ) {
        $schema = $this->getEndpoint()->getSchema();

        return $request->withHeader( 'X-Schema-Version', $schema );
    }
1019955
public static function setVal($metaKey, $elementKey, $elementId, $value)
    {
        $data = self::create()
            ->filterByMetaKey($metaKey)
            ->filterByElementKey($elementKey)
            ->filterByElementId($elementId)
            ->findOne()
        ;

        if (null === $data) {
            $data = new MetaData();
            $data->setMetaKey($metaKey);
            $data->setElementKey($elementKey);
            $data->setElementId($elementId);
        }

        $data->setValue($value);

        $data->save();
    }
695484
public static function setRequest(RequestInterface $request)
    {
        $coroutineId = self::getCoroutineId();
        self::$context[$coroutineId][self::REQUEST_KEY] = $request;
    }
461109
public function execute(RequestInterface $request): RequestInterface
    {
        if ($request->getUri()->getPath() === self::ENDPOINT_INSTALLATION) {
            return $request;
        } else {
            $signature = $this->determineRequestSignature(
                $request->getUri(),
                $request->getMethod(),
                $request->getBody()->getContents(),
                $request->getHeaders()
            );

            return $request->withHeader(self::HEADER_CLIENT_SIGNATURE, $signature);
        }
    }