protected function parseMultiLevelsValueCollection(SimpleXMLElement $content, MultiLevel $multilevel): array
    {
        $value = [];
        $result = [];
        $features = $content->{$multilevel->getRoot()};


        if (! empty($features)) {
            foreach ($features as $key => $feature) {
                foreach ($multilevel as $use) {
                    if (\strpos($use, '{') !== false) {
                        $secondary = $this->resolveUses($use);

                        $value[$secondary->getKey()] = $this->parseMultiLevelsValueCollection($feature, $secondary);
                    } else {
                        list($name, $as) = \strpos($use, '>') !== false ? \explode('>', $use, 2) : [$use, $use];

                        if (\preg_match('/^([A-Za-z0-9_\-\.]+)\((.*)\=(.*)\)$/', $name, $matches)) {
                            $as = alias_get($as, $name);

                            $item = $this->getSelfMatchingValue($feature, $matches, $as);

                            if (\is_null($as)) {
                                $value = \array_merge($value, $item);
                            } else {
                                Arr::set($value, $as, $item);
                            }
                        } else {
                            $name = alias_get($name, '@');

                            Arr::set($value, $as, $this->getValue($feature, $name));
                        }
                    }
                }

                $result[] = $value;
            }
        }

        return $result;
    }
protected function parseMultiLevelsValueCollection(SimpleXMLElement $content, MultiLevel $multilevel): array
    {
        $value = [];
        $result = [];
        $features = $content->{$multilevel->getRoot()};


        if (! empty($features)) {
            foreach ($features as $key => $feature) {
                foreach ($multilevel as $use) {
                    if (\strpos($use, '{') !== false) {
                        $secondary = $this->resolveUses($use);

                        $value[$secondary->getKey()] = $this->parseMultiLevelsValueCollection($feature, $secondary);
                    } else {
                        list($name, $as) = \strpos($use, '>') !== false ? \explode('>', $use, 2) : [$use, $use];

                        if (\preg_match('/^([A-Za-z0-9_\-\.]+)\((.*)\=(.*)\)$/', $name, $matches)) {
                            $as = alias_get($as, $name);

                            $item = $this->getSelfMatchingValue($feature, $matches, $as);

                            if (\is_null($as)) {
                                $value = \array_merge($value, $item);
                            } else {
                                Arr::set($value, $as, $item);
                            }
                        } else {
                            $name = alias_get($name, '@');

                            Arr::set($value, $as, $this->getValue($feature, $name));
                        }
                    }
                }

                $result[] = $value;
            }
        }

        return $result;
    }
protected function parseMultiLevelsValueCollection ( SimpleXMLElement $ content , MultiLevel $ multilevel ) : array { $ value = [ ] ; $ result = [ ] ; $ features = $ content -> { $ multilevel -> getRoot ( ) } ; if ( ! empty ( $ features ) ) { foreach ( $ features as $ key => $ feature ) { foreach ( $ multilevel as $ use ) { if ( \ strpos ( $ use , '{' ) !== false ) { $ secondary = $ this -> resolveUses ( $ use ) ; $ value [ $ secondary -> getKey ( ) ] = $ this -> parseMultiLevelsValueCollection ( $ feature , $ secondary ) ; } else { list ( $ name , $ as ) = \ strpos ( $ use , '>' ) !== false ? \ explode ( '>' , $ use , 2 ) : [ $ use , $ use ] ; if ( \ preg_match ( '/^([A-Za-z0-9_\-\.]+)\((.*)\=(.*)\)$/' , $ name , $ matches ) ) { $ as = alias_get ( $ as , $ name ) ; $ item = $ this -> getSelfMatchingValue ( $ feature , $ matches , $ as ) ; if ( \ is_null ( $ as ) ) { $ value = \ array_merge ( $ value , $ item ) ; } else { Arr :: set ( $ value , $ as , $ item ) ; } } else { $ name = alias_get ( $ name , '@' ) ; Arr :: set ( $ value , $ as , $ this -> getValue ( $ feature , $ name ) ) ; } } } $ result [ ] = $ value ; } } return $ result ; }
Resolve values by collection of multi levels.

@param  \SimpleXMLElement  $content
@param  \Laravie\Parser\Xml\Definitions\MultiLevel  $multilevel

@return array
Resolve values by collection of multi levels .