odata/library/ODataProducer/UriProcessor/QueryProcessor/ExpandProjectionParser/ExpandedProjectionNode.php
/**
     * Sort the selected nodes such that order is same as the order in which 
     * the properties are appear in the owning type.
     * 
     * @return void
     */
Sort the selected nodes such that order is same as the order in which
the properties are appear in the owning type.

@return void
Sort the selected nodes such that order is same as the order in which the properties are appear in the owning type . @return void
public function sortNodes()
    {
        if (count($this->_childNodes) > 0) {
            foreach ($this->_childNodes as $childNode) {
                if ($childNode instanceof ExpandedProjectionNode) {
                        $childNode->sortNodes();
                }
            }
            if (count($this->_childNodes) > 1) {
                $existingNodes = $this->_childNodes;
                $this->_childNodes = array();
                foreach ($this->getResourceType()->getAllProperties() 
                    as $resourceProperty) {
                    $propertyName = $resourceProperty->getName();
                    if (array_key_exists($propertyName, $existingNodes)) {
                        $this->_childNodes[$propertyName] 
                            = $existingNodes[$propertyName];
                    }
                }
            }
        }
    }
public function sortNodes ( ) { if ( count ( $ this -> _childNodes ) > 0 ) { foreach ( $ this -> _childNodes as $ childNode ) { if ( $ childNode instanceof ExpandedProjectionNode ) { $ childNode -> sortNodes ( ) ; } } if ( count ( $ this -> _childNodes ) > 1 ) { $ existingNodes = $ this -> _childNodes ; $ this -> _childNodes = array ( ) ; foreach ( $ this -> getResourceType ( ) -> getAllProperties ( ) as $ resourceProperty ) { $ propertyName = $ resourceProperty -> getName ( ) ; if ( array_key_exists ( $ propertyName , $ existingNodes ) ) { $ this -> _childNodes [ $ propertyName ] = $ existingNodes [ $ propertyName ] ; } } } } }
Sort the selected nodes such that order is same as the order in which
 the properties are appear in the owning type.
Sort the selected nodes such that order is same as the order in which the properties are appear in the owning type .
//We are applying sorting in bottom-up fashion, do it only we have // more than 1 child