protected function expandProperties($path, array $requestedProperties, $depth)
    {
        $foundProperties = $this->server->getPropertiesForPath($path, array_keys($requestedProperties), $depth);

        $result = [];

        foreach ($foundProperties as $node) {
            foreach ($requestedProperties as $propertyName => $childRequestedProperties) {
                // We're only traversing if sub-properties were requested
                if (!is_array($childRequestedProperties) || 0 === count($childRequestedProperties)) {
                    continue;
                }

                // We only have to do the expansion if the property was found
                // and it contains an href element.
                if (!array_key_exists($propertyName, $node[200])) {
                    continue;
                }

                if (!$node[200][$propertyName] instanceof DAV\Xml\Property\Href) {
                    continue;
                }

                $childHrefs = $node[200][$propertyName]->getHrefs();
                $childProps = [];

                foreach ($childHrefs as $href) {
                    // Gathering the result of the children
                    $childProps[] = [
                        'name' => '{DAV:}response',
                        'value' => $this->expandProperties($href, $childRequestedProperties, 0)[0],
                    ];
                }

                // Replacing the property with its expanded form.
                $node[200][$propertyName] = $childProps;
            }
            $result[] = new DAV\Xml\Element\Response($node['href'], $node);
        }

        return $result;
    }
protected function expandProperties($path, array $requestedProperties, $depth)
    {
        $foundProperties = $this->server->getPropertiesForPath($path, array_keys($requestedProperties), $depth);

        $result = [];

        foreach ($foundProperties as $node) {
            foreach ($requestedProperties as $propertyName => $childRequestedProperties) {
                // We're only traversing if sub-properties were requested
                if (!is_array($childRequestedProperties) || 0 === count($childRequestedProperties)) {
                    continue;
                }

                // We only have to do the expansion if the property was found
                // and it contains an href element.
                if (!array_key_exists($propertyName, $node[200])) {
                    continue;
                }

                if (!$node[200][$propertyName] instanceof DAV\Xml\Property\Href) {
                    continue;
                }

                $childHrefs = $node[200][$propertyName]->getHrefs();
                $childProps = [];

                foreach ($childHrefs as $href) {
                    // Gathering the result of the children
                    $childProps[] = [
                        'name' => '{DAV:}response',
                        'value' => $this->expandProperties($href, $childRequestedProperties, 0)[0],
                    ];
                }

                // Replacing the property with its expanded form.
                $node[200][$propertyName] = $childProps;
            }
            $result[] = new DAV\Xml\Element\Response($node['href'], $node);
        }

        return $result;
    }
protected function expandProperties ( $ path , array $ requestedProperties , $ depth ) { $ foundProperties = $ this -> server -> getPropertiesForPath ( $ path , array_keys ( $ requestedProperties ) , $ depth ) ; $ result = [ ] ; foreach ( $ foundProperties as $ node ) { foreach ( $ requestedProperties as $ propertyName => $ childRequestedProperties ) { // We're only traversing if sub-properties were requested if ( ! is_array ( $ childRequestedProperties ) || 0 === count ( $ childRequestedProperties ) ) { continue ; } // We only have to do the expansion if the property was found // and it contains an href element. if ( ! array_key_exists ( $ propertyName , $ node [ 200 ] ) ) { continue ; } if ( ! $ node [ 200 ] [ $ propertyName ] instanceof DAV \ Xml \ Property \ Href ) { continue ; } $ childHrefs = $ node [ 200 ] [ $ propertyName ] -> getHrefs ( ) ; $ childProps = [ ] ; foreach ( $ childHrefs as $ href ) { // Gathering the result of the children $ childProps [ ] = [ 'name' => '{DAV:}response' , 'value' => $ this -> expandProperties ( $ href , $ childRequestedProperties , 0 ) [ 0 ] , ] ; } // Replacing the property with its expanded form. $ node [ 200 ] [ $ propertyName ] = $ childProps ; } $ result [ ] = new DAV \ Xml \ Element \ Response ( $ node [ 'href' ] , $ node ) ; } return $ result ; }
This method expands all the properties and returns
a list with property values.

@param array $path
@param array $requestedProperties the list of required properties
@param int   $depth

@return array
This method expands all the properties and returns a list with property values .