|
@@ -165,7 +165,7 @@ discard block |
|
|
block discarded – undo |
|
165
|
165
|
} |
|
166
|
166
|
// despite all set up, checking, etc, if we haven't picked a concrete resource type, |
|
167
|
167
|
// wheels have fallen off, so blow up |
|
168
|
|
- assert(!$resourceType->isAbstract(), 'Concrete resource type not selected for payload '.$payloadClass); |
|
|
168
|
+ assert(!$resourceType->isAbstract(), 'Concrete resource type not selected for payload ' . $payloadClass); |
|
169
|
169
|
} |
|
170
|
170
|
|
|
171
|
171
|
// make sure we're barking up right tree |
|
@@ -173,7 +173,7 @@ discard block |
|
|
block discarded – undo |
|
173
|
173
|
$targClass = $resourceType->getInstanceType()->getName(); |
|
174
|
174
|
assert( |
|
175
|
175
|
$entryObject->results instanceof $targClass, |
|
176
|
|
- 'Object being serialised not instance of expected class, '.$targClass. ', is actually '.$payloadClass |
|
|
176
|
+ 'Object being serialised not instance of expected class, ' . $targClass . ', is actually ' . $payloadClass |
|
177
|
177
|
); |
|
178
|
178
|
|
|
179
|
179
|
$rawProp = $resourceType->getAllProperties(); |
|
@@ -220,7 +220,7 @@ discard block |
|
|
block discarded – undo |
|
220
|
220
|
.' $propKind != ResourcePropertyKind::RESOURCE_REFERENCE' |
|
221
|
221
|
); |
|
222
|
222
|
$propTail = ResourcePropertyKind::RESOURCE_REFERENCE == $propKind ? 'entry' : 'feed'; |
|
223
|
|
- $propType = 'application/atom+xml;type='.$propTail; |
|
|
223
|
+ $propType = 'application/atom+xml;type=' . $propTail; |
|
224
|
224
|
$propName = $prop->getName(); |
|
225
|
225
|
$nuLink->title = $propName; |
|
226
|
226
|
$nuLink->name = ODataConstants::ODATA_RELATED_NAMESPACE . $propName; |
|
@@ -270,7 +270,7 @@ discard block |
|
|
block discarded – undo |
|
270
|
270
|
* |
|
271
|
271
|
* @return ODataFeed |
|
272
|
272
|
*/ |
|
273
|
|
- public function writeTopLevelElements(QueryResult &$entryObjects) |
|
|
273
|
+ public function writeTopLevelElements(QueryResult & $entryObjects) |
|
274
|
274
|
{ |
|
275
|
275
|
assert(is_array($entryObjects->results), '!is_array($entryObjects->results)'); |
|
276
|
276
|
|
|
@@ -308,7 +308,7 @@ discard block |
|
|
block discarded – undo |
|
308
|
308
|
$resourceSet = $this->getRequest()->getTargetResourceSetWrapper()->getResourceSet(); |
|
309
|
309
|
$requestTop = $this->getRequest()->getTopOptionCount(); |
|
310
|
310
|
$pageSize = $this->getService()->getConfiguration()->getEntitySetPageSize($resourceSet); |
|
311
|
|
- $requestTop = (null === $requestTop) ? $pageSize + 1 : $requestTop; |
|
|
311
|
+ $requestTop = (null === $requestTop) ? $pageSize+1 : $requestTop; |
|
312
|
312
|
|
|
313
|
313
|
if (true === $entryObjects->hasMore && $requestTop > $pageSize) { |
|
314
|
314
|
$stackSegment = $setName; |
|
@@ -391,7 +391,7 @@ discard block |
|
|
block discarded – undo |
|
391
|
391
|
* |
|
392
|
392
|
* @return ODataPropertyContent |
|
393
|
393
|
*/ |
|
394
|
|
- public function writeTopLevelComplexObject(QueryResult &$complexValue, $propertyName, ResourceType &$resourceType) |
|
|
394
|
+ public function writeTopLevelComplexObject(QueryResult & $complexValue, $propertyName, ResourceType & $resourceType) |
|
395
|
395
|
{ |
|
396
|
396
|
$result = $complexValue->results; |
|
397
|
397
|
|
|
@@ -420,14 +420,14 @@ discard block |
|
|
block discarded – undo |
|
420
|
420
|
* bag object |
|
421
|
421
|
* @return ODataPropertyContent |
|
422
|
422
|
*/ |
|
423
|
|
- public function writeTopLevelBagObject(QueryResult &$BagValue, $propertyName, ResourceType &$resourceType) |
|
|
423
|
+ public function writeTopLevelBagObject(QueryResult & $BagValue, $propertyName, ResourceType & $resourceType) |
|
424
|
424
|
{ |
|
425
|
425
|
$result = $BagValue->results; |
|
426
|
426
|
|
|
427
|
427
|
$propertyContent = new ODataPropertyContent(); |
|
428
|
428
|
$odataProperty = new ODataProperty(); |
|
429
|
429
|
$odataProperty->name = $propertyName; |
|
430
|
|
- $odataProperty->typeName = 'Collection('.$resourceType->getFullName().')'; |
|
|
430
|
+ $odataProperty->typeName = 'Collection(' . $resourceType->getFullName() . ')'; |
|
431
|
431
|
$odataProperty->value = $this->writeBagValue($resourceType, $result); |
|
432
|
432
|
|
|
433
|
433
|
$propertyContent->properties[$propertyName] = $odataProperty; |
|
@@ -443,7 +443,7 @@ discard block |
|
|
block discarded – undo |
|
443
|
443
|
* primitive property to be written |
|
444
|
444
|
* @return ODataPropertyContent |
|
445
|
445
|
*/ |
|
446
|
|
- public function writeTopLevelPrimitive(QueryResult &$primitiveValue, ResourceProperty &$resourceProperty = null) |
|
|
446
|
+ public function writeTopLevelPrimitive(QueryResult & $primitiveValue, ResourceProperty & $resourceProperty = null) |
|
447
|
447
|
{ |
|
448
|
448
|
assert(null != $resourceProperty, 'Resource property must not be null'); |
|
449
|
449
|
$propertyContent = new ODataPropertyContent(); |
|
@@ -702,7 +702,7 @@ discard block |
|
|
block discarded – undo |
|
702
|
702
|
$segmentWrappers = $this->getStack()->getSegmentWrappers(); |
|
703
|
703
|
$count = count($segmentWrappers); |
|
704
|
704
|
|
|
705
|
|
- return 0 == $count ? $this->getRequest()->getTargetResourceSetWrapper() : $segmentWrappers[$count - 1]; |
|
|
705
|
+ return 0 == $count ? $this->getRequest()->getTargetResourceSetWrapper() : $segmentWrappers[$count-1]; |
|
706
|
706
|
} |
|
707
|
707
|
|
|
708
|
708
|
/** |
|
@@ -727,7 +727,7 @@ discard block |
|
|
block discarded – undo |
|
727
|
727
|
$skipToken = $internalOrderByInfo->buildSkipTokenValue($lastObject); |
|
728
|
728
|
assert(!is_null($skipToken), '!is_null($skipToken)'); |
|
729
|
729
|
$token = (1 < $numSegments) ? '$skiptoken=' : '$skip='; |
|
730
|
|
- $skipToken = '?'.$queryParameterString.$token.$skipToken; |
|
|
730
|
+ $skipToken = '?' . $queryParameterString . $token . $skipToken; |
|
731
|
731
|
|
|
732
|
732
|
return $skipToken; |
|
733
|
733
|
} |
|
@@ -761,7 +761,7 @@ discard block |
|
|
block discarded – undo |
|
761
|
761
|
|
|
762
|
762
|
$topCountValue = $this->getRequest()->getTopOptionCount(); |
|
763
|
763
|
if (!is_null($topCountValue)) { |
|
764
|
|
- $remainingCount = $topCountValue - $this->getRequest()->getTopCount(); |
|
|
764
|
+ $remainingCount = $topCountValue-$this->getRequest()->getTopCount(); |
|
765
|
765
|
if (0 < $remainingCount) { |
|
766
|
766
|
if (!is_null($queryParameterString)) { |
|
767
|
767
|
$queryParameterString .= '&'; |
|
@@ -796,7 +796,7 @@ discard block |
|
|
block discarded – undo |
|
796
|
796
|
* |
|
797
|
797
|
* @return string |
|
798
|
798
|
*/ |
|
799
|
|
- private function primitiveToString(IType &$type, $primitiveValue) |
|
|
799
|
+ private function primitiveToString(IType & $type, $primitiveValue) |
|
800
|
800
|
{ |
|
801
|
801
|
if ($type instanceof Boolean) { |
|
802
|
802
|
$stringValue = (true === $primitiveValue) ? 'true' : 'false'; |
|
@@ -894,7 +894,7 @@ discard block |
|
|
block discarded – undo |
|
894
|
894
|
* @param $result |
|
895
|
895
|
* @return ODataBagContent|null |
|
896
|
896
|
*/ |
|
897
|
|
- protected function writeBagValue(ResourceType &$resourceType, $result) |
|
|
897
|
+ protected function writeBagValue(ResourceType & $resourceType, $result) |
|
898
|
898
|
{ |
|
899
|
899
|
assert(null == $result || is_array($result), 'Bag parameter must be null or array'); |
|
900
|
900
|
$typeKind = $resourceType->getResourceTypeKind(); |
|
@@ -927,7 +927,7 @@ discard block |
|
|
block discarded – undo |
|
927
|
927
|
* @param string|null $propertyName |
|
928
|
928
|
* @return ODataPropertyContent |
|
929
|
929
|
*/ |
|
930
|
|
- protected function writeComplexValue(ResourceType &$resourceType, &$result, $propertyName = null) |
|
|
930
|
+ protected function writeComplexValue(ResourceType & $resourceType, &$result, $propertyName = null) |
|
931
|
931
|
{ |
|
932
|
932
|
assert(is_object($result), 'Supplied $customObject must be an object'); |
|
933
|
933
|
|