| @@ 797-809 (lines=13) @@ | ||
| 794 | * |
|
| 795 | * @return bool true if the segment was push, false otherwise |
|
| 796 | */ |
|
| 797 | private function _pushSegment($segmentName, ResourceSetWrapper &$resourceSetWrapper) |
|
| 798 | { |
|
| 799 | $rootProjectionNode = $this->request->getRootProjectionNode(); |
|
| 800 | if (!is_null($rootProjectionNode) |
|
| 801 | && $rootProjectionNode->isExpansionSpecified() |
|
| 802 | ) { |
|
| 803 | array_push($this->_segmentNames, $segmentName); |
|
| 804 | array_push($this->_segmentResourceSetWrappers, $resourceSetWrapper); |
|
| 805 | return true; |
|
| 806 | } |
|
| 807 | ||
| 808 | return false; |
|
| 809 | } |
|
| 810 | ||
| 811 | /** |
|
| 812 | * Pops segment information from the 'Segment Stack' |
|
| @@ 389-416 (lines=28) @@ | ||
| 386 | * |
|
| 387 | * @return bool true if the segment was push, false otherwise |
|
| 388 | */ |
|
| 389 | private function _pushSegment($segmentName, ResourceSetWrapper &$resourceSetWrapper) |
|
| 390 | { |
|
| 391 | $rootProjectionNode = $this->request->getRootProjectionNode(); |
|
| 392 | // Even though there is no expand in the request URI, still we need to push |
|
| 393 | // the segment information if we need to count |
|
| 394 | //the number of entities written. |
|
| 395 | // After serializing each entity we should check the count to see whether |
|
| 396 | // we serialized more entities than configured |
|
| 397 | //(page size, maxResultPerCollection). |
|
| 398 | // But we will not do this check since library is doing paging and never |
|
| 399 | // accumulate entities more than configured. |
|
| 400 | // |
|
| 401 | // if ((!is_null($rootProjectionNode) && $rootProjectionNode->isExpansionSpecified()) |
|
| 402 | // || ($resourceSetWrapper->getResourceSetPageSize() != 0) |
|
| 403 | // || ($this->service->getServiceConfiguration()->getMaxResultsPerCollection() != PHP_INT_MAX) |
|
| 404 | //) {} |
|
| 405 | ||
| 406 | if (!is_null($rootProjectionNode) |
|
| 407 | && $rootProjectionNode->isExpansionSpecified() |
|
| 408 | ) { |
|
| 409 | array_push($this->_segmentNames, $segmentName); |
|
| 410 | array_push($this->_segmentResourceSetWrappers, $resourceSetWrapper); |
|
| 411 | array_push($this->_segmentResultCounts, 0); |
|
| 412 | return true; |
|
| 413 | } |
|
| 414 | ||
| 415 | return false; |
|
| 416 | } |
|
| 417 | ||
| 418 | /** |
|
| 419 | * Get next page link from the given entity instance. |
|