src/Resource.php
protected function getNestedPrefix($pattern)
    {
        $segments = explode("/", $pattern);
        $pattern = "";

        foreach ($segments as $index => $segment) {
            if (strpos($segment, "{") === 0) {
                   $pattern .= "/{" . $segments[$index - 1] . "_" . ltrim($segment, "{");
            } else $pattern .= $segment;
        }

        return $pattern;
    }
protected function getNestedPrefix($pattern)
    {
        $segments = explode("/", $pattern);
        $pattern = "";

        foreach ($segments as $index => $segment) {
            if (strpos($segment, "{") === 0) {
                   $pattern .= "/{" . $segments[$index - 1] . "_" . ltrim($segment, "{");
            } else $pattern .= $segment;
        }

        return $pattern;
    }
protected function getNestedPrefix ( $ pattern ) { $ segments = explode ( "/" , $ pattern ) ; $ pattern = "" ; foreach ( $ segments as $ index => $ segment ) { if ( strpos ( $ segment , "{" ) === 0 ) { $ pattern .= "/{" . $ segments [ $ index - 1 ] . "_" . ltrim ( $ segment , "{" ) ; } else $ pattern .= $ segment ; } return $ pattern ; }
Resolve the nesting pattern, setting the prefixes based on
parent resources patterns.

@param string $pattern
@return string
Resolve the nesting pattern setting the prefixes based on parent resources patterns .