|
@@ -164,7 +164,7 @@ discard block |
|
|
block discarded – undo |
|
164
|
164
|
} |
|
165
|
165
|
// despite all set up, checking, etc, if we haven't picked a concrete resource type, |
|
166
|
166
|
// wheels have fallen off, so blow up |
|
167
|
|
- assert(!$resourceType->isAbstract(), 'Concrete resource type not selected for payload '.$payloadClass); |
|
|
167
|
+ assert(!$resourceType->isAbstract(), 'Concrete resource type not selected for payload ' . $payloadClass); |
|
168
|
168
|
} |
|
169
|
169
|
|
|
170
|
170
|
// make sure we're barking up right tree |
|
@@ -172,7 +172,7 @@ discard block |
|
|
block discarded – undo |
|
172
|
172
|
$targClass = $resourceType->getInstanceType()->getName(); |
|
173
|
173
|
assert( |
|
174
|
174
|
$entryObject->results instanceof $targClass, |
|
175
|
|
- 'Object being serialised not instance of expected class, '.$targClass. ', is actually '.$payloadClass |
|
|
175
|
+ 'Object being serialised not instance of expected class, ' . $targClass . ', is actually ' . $payloadClass |
|
176
|
176
|
); |
|
177
|
177
|
|
|
178
|
178
|
$rawProp = $resourceType->getAllProperties(); |
|
@@ -219,7 +219,7 @@ discard block |
|
|
block discarded – undo |
|
219
|
219
|
.' $propKind != ResourcePropertyKind::RESOURCE_REFERENCE' |
|
220
|
220
|
); |
|
221
|
221
|
$propTail = ResourcePropertyKind::RESOURCE_REFERENCE == $propKind ? 'entry' : 'feed'; |
|
222
|
|
- $propType = 'application/atom+xml;type='.$propTail; |
|
|
222
|
+ $propType = 'application/atom+xml;type=' . $propTail; |
|
223
|
223
|
$propName = $prop->getName(); |
|
224
|
224
|
$nuLink->title = $propName; |
|
225
|
225
|
$nuLink->name = ODataConstants::ODATA_RELATED_NAMESPACE . $propName; |
|
@@ -266,7 +266,7 @@ discard block |
|
|
block discarded – undo |
|
266
|
266
|
* |
|
267
|
267
|
* @return ODataFeed |
|
268
|
268
|
*/ |
|
269
|
|
- public function writeTopLevelElements(QueryResult &$entryObjects) |
|
|
269
|
+ public function writeTopLevelElements(QueryResult & $entryObjects) |
|
270
|
270
|
{ |
|
271
|
271
|
assert(is_array($entryObjects->results), '!is_array($entryObjects->results)'); |
|
272
|
272
|
|
|
@@ -304,7 +304,7 @@ discard block |
|
|
block discarded – undo |
|
304
|
304
|
$resourceSet = $this->getRequest()->getTargetResourceSetWrapper()->getResourceSet(); |
|
305
|
305
|
$requestTop = $this->getRequest()->getTopOptionCount(); |
|
306
|
306
|
$pageSize = $this->getService()->getConfiguration()->getEntitySetPageSize($resourceSet); |
|
307
|
|
- $requestTop = (null === $requestTop) ? $pageSize + 1 : $requestTop; |
|
|
307
|
+ $requestTop = (null === $requestTop) ? $pageSize+1 : $requestTop; |
|
308
|
308
|
|
|
309
|
309
|
if (true === $entryObjects->hasMore && $requestTop > $pageSize) { |
|
310
|
310
|
$stackSegment = $setName; |
|
@@ -387,7 +387,7 @@ discard block |
|
|
block discarded – undo |
|
387
|
387
|
* |
|
388
|
388
|
* @return ODataPropertyContent |
|
389
|
389
|
*/ |
|
390
|
|
- public function writeTopLevelComplexObject(QueryResult &$complexValue, $propertyName, ResourceType &$resourceType) |
|
|
390
|
+ public function writeTopLevelComplexObject(QueryResult & $complexValue, $propertyName, ResourceType & $resourceType) |
|
391
|
391
|
{ |
|
392
|
392
|
$result = $complexValue->results; |
|
393
|
393
|
|
|
@@ -416,14 +416,14 @@ discard block |
|
|
block discarded – undo |
|
416
|
416
|
* bag object |
|
417
|
417
|
* @return ODataPropertyContent |
|
418
|
418
|
*/ |
|
419
|
|
- public function writeTopLevelBagObject(QueryResult &$BagValue, $propertyName, ResourceType &$resourceType) |
|
|
419
|
+ public function writeTopLevelBagObject(QueryResult & $BagValue, $propertyName, ResourceType & $resourceType) |
|
420
|
420
|
{ |
|
421
|
421
|
$result = $BagValue->results; |
|
422
|
422
|
|
|
423
|
423
|
$propertyContent = new ODataPropertyContent(); |
|
424
|
424
|
$odataProperty = new ODataProperty(); |
|
425
|
425
|
$odataProperty->name = $propertyName; |
|
426
|
|
- $odataProperty->typeName = 'Collection('.$resourceType->getFullName().')'; |
|
|
426
|
+ $odataProperty->typeName = 'Collection(' . $resourceType->getFullName() . ')'; |
|
427
|
427
|
$odataProperty->value = $this->writeBagValue($resourceType, $result); |
|
428
|
428
|
|
|
429
|
429
|
$propertyContent->properties[] = $odataProperty; |
|
@@ -439,7 +439,7 @@ discard block |
|
|
block discarded – undo |
|
439
|
439
|
* primitive property to be written |
|
440
|
440
|
* @return ODataPropertyContent |
|
441
|
441
|
*/ |
|
442
|
|
- public function writeTopLevelPrimitive(QueryResult &$primitiveValue, ResourceProperty &$resourceProperty = null) |
|
|
442
|
+ public function writeTopLevelPrimitive(QueryResult & $primitiveValue, ResourceProperty & $resourceProperty = null) |
|
443
|
443
|
{ |
|
444
|
444
|
assert(null != $resourceProperty, 'Resource property must not be null'); |
|
445
|
445
|
$propertyContent = new ODataPropertyContent(); |
|
@@ -698,7 +698,7 @@ discard block |
|
|
block discarded – undo |
|
698
|
698
|
$segmentWrappers = $this->getStack()->getSegmentWrappers(); |
|
699
|
699
|
$count = count($segmentWrappers); |
|
700
|
700
|
|
|
701
|
|
- return 0 == $count ? $this->getRequest()->getTargetResourceSetWrapper() : $segmentWrappers[$count - 1]; |
|
|
701
|
+ return 0 == $count ? $this->getRequest()->getTargetResourceSetWrapper() : $segmentWrappers[$count-1]; |
|
702
|
702
|
} |
|
703
|
703
|
|
|
704
|
704
|
/** |
|
@@ -723,7 +723,7 @@ discard block |
|
|
block discarded – undo |
|
723
|
723
|
$skipToken = $internalOrderByInfo->buildSkipTokenValue($lastObject); |
|
724
|
724
|
assert(!is_null($skipToken), '!is_null($skipToken)'); |
|
725
|
725
|
$token = (1 < $numSegments) ? '$skiptoken=' : '$skip='; |
|
726
|
|
- $skipToken = '?'.$queryParameterString.$token.$skipToken; |
|
|
726
|
+ $skipToken = '?' . $queryParameterString . $token . $skipToken; |
|
727
|
727
|
|
|
728
|
728
|
return $skipToken; |
|
729
|
729
|
} |
|
@@ -757,7 +757,7 @@ discard block |
|
|
block discarded – undo |
|
757
|
757
|
|
|
758
|
758
|
$topCountValue = $this->getRequest()->getTopOptionCount(); |
|
759
|
759
|
if (!is_null($topCountValue)) { |
|
760
|
|
- $remainingCount = $topCountValue - $this->getRequest()->getTopCount(); |
|
|
760
|
+ $remainingCount = $topCountValue-$this->getRequest()->getTopCount(); |
|
761
|
761
|
if (0 < $remainingCount) { |
|
762
|
762
|
if (!is_null($queryParameterString)) { |
|
763
|
763
|
$queryParameterString .= '&'; |
|
@@ -792,7 +792,7 @@ discard block |
|
|
block discarded – undo |
|
792
|
792
|
* |
|
793
|
793
|
* @return string |
|
794
|
794
|
*/ |
|
795
|
|
- private function primitiveToString(IType &$type, $primitiveValue) |
|
|
795
|
+ private function primitiveToString(IType & $type, $primitiveValue) |
|
796
|
796
|
{ |
|
797
|
797
|
if ($type instanceof Boolean) { |
|
798
|
798
|
$stringValue = (true === $primitiveValue) ? 'true' : 'false'; |
|
@@ -890,7 +890,7 @@ discard block |
|
|
block discarded – undo |
|
890
|
890
|
* @param $result |
|
891
|
891
|
* @return ODataBagContent|null |
|
892
|
892
|
*/ |
|
893
|
|
- protected function writeBagValue(ResourceType &$resourceType, $result) |
|
|
893
|
+ protected function writeBagValue(ResourceType & $resourceType, $result) |
|
894
|
894
|
{ |
|
895
|
895
|
assert(null == $result || is_array($result), 'Bag parameter must be null or array'); |
|
896
|
896
|
$typeKind = $resourceType->getResourceTypeKind(); |
|
@@ -923,7 +923,7 @@ discard block |
|
|
block discarded – undo |
|
923
|
923
|
* @param string|null $propertyName |
|
924
|
924
|
* @return ODataPropertyContent |
|
925
|
925
|
*/ |
|
926
|
|
- protected function writeComplexValue(ResourceType &$resourceType, &$result, $propertyName = null) |
|
|
926
|
+ protected function writeComplexValue(ResourceType & $resourceType, &$result, $propertyName = null) |
|
927
|
927
|
{ |
|
928
|
928
|
assert(is_object($result), 'Supplied $customObject must be an object'); |
|
929
|
929
|
|