src/POData/UriProcessor/QueryProcessor/QueryProcessor.php
/**
     * Process the $inlinecount option and update the request description.
     *
     * @return void
     * 
     * @throws ODataException Throws bad request error in the following cases
     *                          (1) If $inlinecount is disabled by the developer
     *                          (2) If both $count and $inlinecount specified
     *                          (3) If $inlinecount value is unknown
     *                          (4) If capability negotiation over version fails
     */
Process the $inlinecount option and update the request description.
@return void

@throws ODataException Throws bad request error in the following cases
(1) If $inlinecount is disabled by the developer
(2) If both $count and $inlinecount specified
(3) If $inlinecount value is unknown
(4) If capability negotiation over version fails
Process the $inlinecount option and update the request description . @return void @throws ODataException Throws bad request error in the following cases ( 1 ) If $inlinecount is disabled by the developer ( 2 ) If both $count and $inlinecount specified ( 3 ) If $inlinecount value is unknown ( 4 ) If capability negotiation over version fails
private function _processCount()
    {
        $inlineCount = $this->service->getHost()->getQueryStringItem( ODataConstants::HTTPQUERY_STRING_INLINECOUNT );
	    if(is_null($inlineCount)) return;
        if (!$this->service->getConfiguration()->getAcceptCountRequests()) {
			throw ODataException::createBadRequestError(
                Messages::configurationCountNotAccepted()
            );
        }
        $inlineCount = trim($inlineCount);
        if ($inlineCount === ODataConstants::URI_ROWCOUNT_OFFOPTION) {
            return;
        }
        if ($this->request->queryType == QueryType::COUNT() ) {
			throw ODataException::createBadRequestError(
                Messages::queryProcessorInlineCountWithValueCount()
            );
        }
        $this->_checkSetQueryApplicable(); 
        if ($inlineCount === ODataConstants::URI_ROWCOUNT_ALLOPTION) {
	        $this->request->queryType = QueryType::ENTITIES_WITH_COUNT();
            $this->request->raiseMinVersionRequirement( 2, 0 );
            $this->request->raiseResponseVersion( 2, 0 );
        } else {
			throw ODataException::createBadRequestError(
                Messages::queryProcessorInvalidInlineCountOptionError()
            );
        }
    }
private function _processCount ( ) { $ inlineCount = $ this -> service -> getHost ( ) -> getQueryStringItem ( ODataConstants :: HTTPQUERY_STRING_INLINECOUNT ) ; if ( is_null ( $ inlineCount ) ) return ; if ( ! $ this -> service -> getConfiguration ( ) -> getAcceptCountRequests ( ) ) { throw ODataException :: createBadRequestError ( Messages :: configurationCountNotAccepted ( ) ) ; } $ inlineCount = trim ( $ inlineCount ) ; if ( $ inlineCount === ODataConstants :: URI_ROWCOUNT_OFFOPTION ) { return ; } if ( $ this -> request -> queryType == QueryType :: COUNT ( ) ) { throw ODataException :: createBadRequestError ( Messages :: queryProcessorInlineCountWithValueCount ( ) ) ; } $ this -> _checkSetQueryApplicable ( ) ; if ( $ inlineCount === ODataConstants :: URI_ROWCOUNT_ALLOPTION ) { $ this -> request -> queryType = QueryType :: ENTITIES_WITH_COUNT ( ) ; $ this -> request -> raiseMinVersionRequirement ( 2 , 0 ) ; $ this -> request -> raiseResponseVersion ( 2 , 0 ) ; } else { throw ODataException :: createBadRequestError ( Messages :: queryProcessorInvalidInlineCountOptionError ( ) ) ; } }
Process the $inlinecount option and update the request description.
Process the $inlinecount option and update the request description .
//If it's not specified, we're done //If the service doesn't allow count requests..then throw an exception //if it's set to none, we don't do inline counts //You can't specify $count & $inlinecount together //TODO: ensure there's a test for this case see #55 //TODO: why do we do this check?
