コード例 #1
0
ファイル: QueryProcessor.php プロジェクト: i-geo/odataphpprod
 /**
  * Process the $skiptoken option in the request and update the request 
  * description, this function requires _processOrderBy method to be
  * already invoked.
  * 
  * @return void
  * 
  * @throws ODataException Throws bad request error in the following cases
  *                          (1) If $skiptoken cannot be applied to the 
  *                              resource targetted by the request uri
  *                          (2) If paging is not enabled for the resource
  *                              targetted by the request uri
  *                          (3) If parsing of $skiptoken fails
  *                          (4) If capability negotiation over version fails
  */
 private function _processSkipToken()
 {
     $skipToken = $this->_dataService->getHost()->getQueryStringItem(ODataConstants::HTTPQUERY_STRING_SKIPTOKEN);
     if (!is_null($skipToken)) {
         if (!$this->_pagingApplicable) {
             ODataException::createBadRequestError(Messages::queryProcessorSkipTokenNotAllowed());
         }
         if (!$this->_isSSPagingRequired()) {
             ODataException::createBadRequestError(Messages::queryProcessorSkipTokenCannotBeAppliedForNonPagedResourceSet());
         }
         $internalOrderByInfo = $this->_requestDescription->getInternalOrderByInfo();
         //assert($internalOrderByInfo != null)
         $targetResourceType = $this->_requestDescription->getTargetResourceType();
         //assert($targetResourceType != null)
         try {
             $internalSkipTokenInfo = SkipTokenParser::parseSkipTokenClause($targetResourceType, $internalOrderByInfo, $skipToken);
             $this->_requestDescription->setInternalSkipTokenInfo($internalSkipTokenInfo);
             $this->_requestDescription->raiseMinimumVersionRequirement(2, 0, $this->_dataService);
             $this->_requestDescription->raiseResponseVersion(2, 0, $this->_dataService);
         } catch (ODataException $odataException) {
             throw $odataException;
         }
     }
 }