| @@ 388-415 (lines=28) @@ | ||
| 385 | * |
|
| 386 | * @return bool true if the segment was push, false otherwise |
|
| 387 | */ |
|
| 388 | private function _pushSegment($segmentName, ResourceSetWrapper &$resourceSetWrapper) |
|
| 389 | { |
|
| 390 | $rootProjectionNode = $this->request->getRootProjectionNode(); |
|
| 391 | // Even though there is no expand in the request URI, still we need to push |
|
| 392 | // the segment information if we need to count |
|
| 393 | //the number of entities written. |
|
| 394 | // After serializing each entity we should check the count to see whether |
|
| 395 | // we serialized more entities than configured |
|
| 396 | //(page size, maxResultPerCollection). |
|
| 397 | // But we will not do this check since library is doing paging and never |
|
| 398 | // accumulate entities more than configured. |
|
| 399 | // |
|
| 400 | // if ((!is_null($rootProjectionNode) && $rootProjectionNode->isExpansionSpecified()) |
|
| 401 | // || ($resourceSetWrapper->getResourceSetPageSize() != 0) |
|
| 402 | // || ($this->service->getServiceConfiguration()->getMaxResultsPerCollection() != PHP_INT_MAX) |
|
| 403 | //) {} |
|
| 404 | ||
| 405 | if (!is_null($rootProjectionNode) |
|
| 406 | && $rootProjectionNode->isExpansionSpecified() |
|
| 407 | ) { |
|
| 408 | array_push($this->_segmentNames, $segmentName); |
|
| 409 | array_push($this->_segmentResourceSetWrappers, $resourceSetWrapper); |
|
| 410 | array_push($this->_segmentResultCounts, 0); |
|
| 411 | return true; |
|
| 412 | } |
|
| 413 | ||
| 414 | return false; |
|
| 415 | } |
|
| 416 | ||
| 417 | /** |
|
| 418 | * Get next page link from the given entity instance. |
|
| @@ 767-779 (lines=13) @@ | ||
| 764 | * |
|
| 765 | * @return bool true if the segment was push, false otherwise |
|
| 766 | */ |
|
| 767 | private function _pushSegment($segmentName, ResourceSetWrapper &$resourceSetWrapper) |
|
| 768 | { |
|
| 769 | $rootProjectionNode = $this->request->getRootProjectionNode(); |
|
| 770 | if (!is_null($rootProjectionNode) |
|
| 771 | && $rootProjectionNode->isExpansionSpecified() |
|
| 772 | ) { |
|
| 773 | array_push($this->_segmentNames, $segmentName); |
|
| 774 | array_push($this->_segmentResourceSetWrappers, $resourceSetWrapper); |
|
| 775 | return true; |
|
| 776 | } |
|
| 777 | ||
| 778 | return false; |
|
| 779 | } |
|
| 780 | ||
| 781 | /** |
|
| 782 | * Pops segment information from the 'Segment Stack' |
|