src/POData/UriProcessor/QueryProcessor/QueryProcessor.php
/**
     * Process $orderby option, This function requires _processSkipAndTopOption
     * function to be already called as this function need to know whether 
     * client has requested for skip, top or paging is enabled for the 
     * requested resource in these cases function generates additional orderby
     * expression using keys.
     * 
     * @return void
     * 
     * @throws ODataException If any error occurs while parsing orderby option.
     */
Process $orderby option, This function requires _processSkipAndTopOption
function to be already called as this function need to know whether
client has requested for skip, top or paging is enabled for the
requested resource in these cases function generates additional orderby
expression using keys.

@return void

@throws ODataException If any error occurs while parsing orderby option.
Process $orderby option This function requires _processSkipAndTopOption function to be already called as this function need to know whether client has requested for skip top or paging is enabled for the requested resource in these cases function generates additional orderby expression using keys . @return void @throws ODataException If any error occurs while parsing orderby option .
private function _processOrderBy()
    {
        $orderBy = $this->service->getHost()->getQueryStringItem( ODataConstants::HTTPQUERY_STRING_ORDERBY );
        if (!is_null($orderBy)) {
            $this->_checkSetQueryApplicable();
        }
        $targetResourceType = $this->request->getTargetResourceType();
        if (!is_null($this->request->getSkipCount())|| !is_null($this->request->getTopCount())) {
            $orderBy = !is_null($orderBy) ? $orderBy . ', ' : null;
            $keys = array_keys($targetResourceType->getKeyProperties());
            foreach ($keys as $key) {
                $orderBy = $orderBy . $key . ', ';
            }
            $orderBy = rtrim($orderBy, ', ');
        }
        if (!is_null($orderBy)) {
            $internalOrderByInfo = OrderByParser::parseOrderByClause(
                $this->request->getTargetResourceSetWrapper(),
                $targetResourceType,
                $orderBy,
                $this->service->getProvidersWrapper()
            );
            $this->request->setInternalOrderByInfo(
                $internalOrderByInfo
            );
        }
    }
private function _processOrderBy ( ) { $ orderBy = $ this -> service -> getHost ( ) -> getQueryStringItem ( ODataConstants :: HTTPQUERY_STRING_ORDERBY ) ; if ( ! is_null ( $ orderBy ) ) { $ this -> _checkSetQueryApplicable ( ) ; } $ targetResourceType = $ this -> request -> getTargetResourceType ( ) ; if ( ! is_null ( $ this -> request -> getSkipCount ( ) ) || ! is_null ( $ this -> request -> getTopCount ( ) ) ) { $ orderBy = ! is_null ( $ orderBy ) ? $ orderBy . ', ' : null ; $ keys = array_keys ( $ targetResourceType -> getKeyProperties ( ) ) ; foreach ( $ keys as $ key ) { $ orderBy = $ orderBy . $ key . ', ' ; } $ orderBy = rtrim ( $ orderBy , ', ' ) ; } if ( ! is_null ( $ orderBy ) ) { $ internalOrderByInfo = OrderByParser :: parseOrderByClause ( $ this -> request -> getTargetResourceSetWrapper ( ) , $ targetResourceType , $ orderBy , $ this -> service -> getProvidersWrapper ( ) ) ; $ this -> request -> setInternalOrderByInfo ( $ internalOrderByInfo ) ; } }
Process $orderby option, This function requires _processSkipAndTopOption
 function to be already called as this function need to know whether
 client has requested for skip, top or paging is enabled for the
 requested resource in these cases function generates additional orderby
 expression using keys.
Process $orderby option This function requires _processSkipAndTopOption function to be already called as this function need to know whether client has requested for skip top or paging is enabled for the requested resource in these cases function generates additional orderby expression using keys .
//assert($targetResourceType != null) /**
         * We need to do sorting in the folowing cases, irrespective of 
         * $orderby clause is present or not.
         * 1. If $top or $skip is specified
         *     skip and take will be applied on sorted list only. If $skip 
         *     is specified then RequestDescription::getSkipCount will give 
         *     non-null value. If $top is specified then 
         *     RequestDescription::getTopCount will give non-null value.
         * 2. If server side paging is enabled for the requested resource
         *     If server-side paging is enabled for the requested resource then 
         *     RequestDescription::getTopCount will give non-null value.
         *      
         */ //assert(!empty($keys))