private function readNode(Finder $finder)
    {
        $uri = str_replace($this->contentPath, '', $finder->getPath());
        $uri = !$uri ? '/' : $uri;

        if(false !== $finder->getPropertiesPath())
        {
            $properties = PropertiesParser::parse($finder);
            $node = new Node($properties['name'], $uri);

            //Set properties
            foreach($properties['properties'] as $key => $value)
            {
                $node->setProperty($key, $value);
            }

            //Read properties from parent nodes
            $parentDir = realpath(dirname($finder->getPropertiesPath()));

            while(strcmp($this->contentPath, $parentDir) <= 0)
            {
                $parentFinder = new Finder($parentDir);
                if(false !== $parentFinder->getPropertiesPath())
                {
                    $properties = PropertiesParser::parse($parentFinder);
                    foreach($properties['properties'] as $key => $value)
                    {
                        if((substr($key, 0, 5) == 'tree_') && !$node->hasProperty($key))
                        {
                            $node->setProperty($key, $value);
                        }
                    }
                }
                else
                {
                    throw new SitemapException(sprintf('Unable to read properties [%s].', $parentFinder->getPath()));
                }
                $parentDir = realpath($parentDir . '/..');
            }

            return $node;
        }

        throw new SitemapException(sprintf('Unable to read node for request [%s].', $uri));
    }
private function readNode(Finder $finder)
    {
        $uri = str_replace($this->contentPath, '', $finder->getPath());
        $uri = !$uri ? '/' : $uri;

        if(false !== $finder->getPropertiesPath())
        {
            $properties = PropertiesParser::parse($finder);
            $node = new Node($properties['name'], $uri);

            //Set properties
            foreach($properties['properties'] as $key => $value)
            {
                $node->setProperty($key, $value);
            }

            //Read properties from parent nodes
            $parentDir = realpath(dirname($finder->getPropertiesPath()));

            while(strcmp($this->contentPath, $parentDir) <= 0)
            {
                $parentFinder = new Finder($parentDir);
                if(false !== $parentFinder->getPropertiesPath())
                {
                    $properties = PropertiesParser::parse($parentFinder);
                    foreach($properties['properties'] as $key => $value)
                    {
                        if((substr($key, 0, 5) == 'tree_') && !$node->hasProperty($key))
                        {
                            $node->setProperty($key, $value);
                        }
                    }
                }
                else
                {
                    throw new SitemapException(sprintf('Unable to read properties [%s].', $parentFinder->getPath()));
                }
                $parentDir = realpath($parentDir . '/..');
            }

            return $node;
        }

        throw new SitemapException(sprintf('Unable to read node for request [%s].', $uri));
    }
private function readNode ( Finder $ finder ) { $ uri = str_replace ( $ this -> contentPath , '' , $ finder -> getPath ( ) ) ; $ uri = ! $ uri ? '/' : $ uri ; if ( false !== $ finder -> getPropertiesPath ( ) ) { $ properties = PropertiesParser :: parse ( $ finder ) ; $ node = new Node ( $ properties [ 'name' ] , $ uri ) ; //Set properties foreach ( $ properties [ 'properties' ] as $ key => $ value ) { $ node -> setProperty ( $ key , $ value ) ; } //Read properties from parent nodes $ parentDir = realpath ( dirname ( $ finder -> getPropertiesPath ( ) ) ) ; while ( strcmp ( $ this -> contentPath , $ parentDir ) <= 0 ) { $ parentFinder = new Finder ( $ parentDir ) ; if ( false !== $ parentFinder -> getPropertiesPath ( ) ) { $ properties = PropertiesParser :: parse ( $ parentFinder ) ; foreach ( $ properties [ 'properties' ] as $ key => $ value ) { if ( ( substr ( $ key , 0 , 5 ) == 'tree_' ) && ! $ node -> hasProperty ( $ key ) ) { $ node -> setProperty ( $ key , $ value ) ; } } } else { throw new SitemapException ( sprintf ( 'Unable to read properties [%s].' , $ parentFinder -> getPath ( ) ) ) ; } $ parentDir = realpath ( $ parentDir . '/..' ) ; } return $ node ; } throw new SitemapException ( sprintf ( 'Unable to read node for request [%s].' , $ uri ) ) ; }
Recursively reads Node properties. Node is not a structure

@throws \Coral\SiteBundle\Exception\SitemapException in case .properties file is missing
@return Node
Recursively reads Node properties . Node is not a structure