src/POData/UriProcessor/UriProcessor.php
/**
     * Applies the query options to the resource(s) retrieved from the data source.
     * 
     * @param SegmentDescriptor $segment The descriptor which holds resource(s) on which query options to be applied.
     *
     */
Applies the query options to the resource(s) retrieved from the data source.

@param SegmentDescriptor $segment The descriptor which holds resource(s) on which query options to be applied.
Applies the query options to the resource ( s ) retrieved from the data source . @param SegmentDescriptor $segment The descriptor which holds resource ( s ) on which query options to be applied .
private function applyQueryOptions(SegmentDescriptor $segment)
    {
	    $result = $segment->getResult();
	    if(!$result instanceof QueryResult){
		    return;
        }
        if ($this->request->queryType == QueryType::ENTITIES_WITH_COUNT()) {
            if ($this->providers->handlesOrderedPaging()) {
                $this->request->setCountValue($result->count);
            } else {
                $this->request->setCountValue(count($result->results));
            }
        }
	    if(!$this->providers->handlesOrderedPaging() && !empty($result->results)){
			$result->results = $this->performPaging($result->results);
	    }
	    if ($this->request->queryType == QueryType::COUNT()) {
		    if ($this->providers->handlesOrderedPaging()) {
			    $this->request->setCountValue($result->count);
		    } else {
			    $this->request->setCountValue(count($result->results));
		    }
	    }
        $segment->setResult($result->results);
    }
private function applyQueryOptions ( SegmentDescriptor $ segment ) { $ result = $ segment -> getResult ( ) ; if ( ! $ result instanceof QueryResult ) { return ; } if ( $ this -> request -> queryType == QueryType :: ENTITIES_WITH_COUNT ( ) ) { if ( $ this -> providers -> handlesOrderedPaging ( ) ) { $ this -> request -> setCountValue ( $ result -> count ) ; } else { $ this -> request -> setCountValue ( count ( $ result -> results ) ) ; } } if ( ! $ this -> providers -> handlesOrderedPaging ( ) && ! empty ( $ result -> results ) ) { $ result -> results = $ this -> performPaging ( $ result -> results ) ; } if ( $ this -> request -> queryType == QueryType :: COUNT ( ) ) { if ( $ this -> providers -> handlesOrderedPaging ( ) ) { $ this -> request -> setCountValue ( $ result -> count ) ; } else { $ this -> request -> setCountValue ( count ( $ result -> results ) ) ; } } $ segment -> setResult ( $ result -> results ) ; }
Applies the query options to the resource(s) retrieved from the data source.
Applies the query options to the resource ( s ) retrieved from the data source .
//TODO: I'm not really happy with this..i think i'd rather keep the result the QueryResult //not even bother with the setCountValue stuff (shouldn't counts be on segments?) //and just work with the QueryResult in the object model serializer //If the segment isn't a query result, then there's no paging or counting to be done // Note $inlinecount=allpages means include the total count regardless of paging..so we set the counts first // regardless if POData does the paging or not. //Have POData perform paging if necessary //a bit surprising, but $skip and $top affects $count so update it here, not above //IE  data.svc/Collection/$count?$top=10 returns 10 even if Collection has 11+ entries