DmitryDulepov\Realurl\Decoder\UrlDecoder::decodePostVarSets PHP Метод

decodePostVarSets() защищенный Метод

Decodes postVarSets into request variables.
protected decodePostVarSets ( integer $pageId, array &$pathSegments ) : array
$pageId integer
$pathSegments array
Результат array
    protected function decodePostVarSets($pageId, array &$pathSegments)
    {
        $requestVariables = array();
        if (count($pathSegments) > 0) {
            $allPostVarSets = array_filter((array) $this->configuration->get('postVarSets'));
            $postVarSets = $this->getConfigurationForPostVars($allPostVarSets, $pageId);
            $previousValue = '';
            while (count($pathSegments) > 0) {
                $postVarSetKey = array_shift($pathSegments);
                if (!isset($postVarSets[$postVarSetKey]) || !is_array($postVarSets[$postVarSetKey])) {
                    $this->handleNonExistingPostVarSet($pageId, $postVarSetKey, $pathSegments);
                } else {
                    $postVarSetConfiguration = $postVarSets[$postVarSetKey];
                    // Note: we do not support aliases for postVarSets!
                    if (is_array($postVarSetConfiguration)) {
                        foreach ($postVarSetConfiguration as $postVarConfiguration) {
                            $this->decodeSingleVariable($postVarConfiguration, $pathSegments, $requestVariables, $previousValue);
                        }
                    }
                }
            }
        }
        return $requestVariables;
    }