예제 #1
0
 /**
  * Pushes information about the segment whose instance is going to be
  * retrieved from the IDSQP implementation
  * Note: Calls to this method should be balanced with calls to popSegment.
  *
  * @param string             $segmentName         Name of segment to push.
  * @param ResourceSetWrapper &$resourceSetWrapper The resource set wrapper 
  *                                                to push.
  *
  * @return true if the segment was push, false otherwise
  */
 private function _pushSegment($segmentName, ResourceSetWrapper &$resourceSetWrapper)
 {
     $rootProjectionNode = $this->_requestDescription->getRootProjectionNode();
     if (!is_null($rootProjectionNode) && $rootProjectionNode->isExpansionSpecified()) {
         array_push($this->_segmentNames, $segmentName);
         array_push($this->_segmentResourceSetWrappers, $resourceSetWrapper);
         return true;
     }
     return false;
 }
 /**
  * Pushes information about the segment that is going to be serialized 
  * to the 'Segment Stack'.
  * Note: Refer 'ObjectModelSerializerNotes.txt' for more details about
  * 'Segment Stack' and this method.
  * Note: Calls to this method should be balanced with calls to popSegment.
  * 
  * @param string             $segmentName         Name of segment to push.
  * @param ResourceSetWrapper &$resourceSetWrapper The resource set 
  *                                                wrapper to push.
  * 
  * @return true if the segment was push, false otherwise
  */
 private function _pushSegment($segmentName, ResourceSetWrapper &$resourceSetWrapper)
 {
     $rootProjectionNode = $this->requestDescription->getRootProjectionNode();
     // Even though there is no expand in the request URI, still we need to push
     // the segment information if we need to count
     //the number of entities written.
     // After serializing each entity we should check the count to see whether
     // we serialized more entities than configured
     //(page size, maxResultPerCollection).
     // But we will not do this check since library is doing paging and never
     // accumulate entities more than configured.
     //
     // if ((!is_null($rootProjectionNode) && $rootProjectionNode->isExpansionSpecified())
     //    || ($resourceSetWrapper->getResourceSetPageSize() != 0)
     //    || ($this->dataService->getServiceConfiguration()->getMaxResultsPerCollection() != PHP_INT_MAX)
     //) {}
     if (!is_null($rootProjectionNode) && $rootProjectionNode->isExpansionSpecified()) {
         array_push($this->_segmentNames, $segmentName);
         array_push($this->_segmentResourceSetWrappers, $resourceSetWrapper);
         array_push($this->_segmentResultCounts, 0);
         return true;
     }
     return false;
 }