@@ -45,9 +45,9 @@ |
||
| 45 | 45 | public function isCompatibleWith(IType $type) |
| 46 | 46 | { |
| 47 | 47 | switch ($type->getTypeCode()) { |
| 48 | - case TypeCode::BYTE: |
|
| 49 | - case TypeCode::CHAR: |
|
| 50 | - return true; |
|
| 48 | + case TypeCode::BYTE: |
|
| 49 | + case TypeCode::CHAR: |
|
| 50 | + return true; |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | return false; |
@@ -31,14 +31,14 @@ |
||
| 31 | 31 | public function isCompatibleWith(IType $type) |
| 32 | 32 | { |
| 33 | 33 | switch ($type->getTypeCode()) { |
| 34 | - case TypeCode::BYTE: |
|
| 35 | - case TypeCode::SBYTE: |
|
| 36 | - case TypeCode::INT16: |
|
| 37 | - case TypeCode::INT32: |
|
| 38 | - case TypeCode::INT64: |
|
| 39 | - case TypeCode::DOUBLE: |
|
| 40 | - case TypeCode::DECIMAL: |
|
| 41 | - return true; |
|
| 34 | + case TypeCode::BYTE: |
|
| 35 | + case TypeCode::SBYTE: |
|
| 36 | + case TypeCode::INT16: |
|
| 37 | + case TypeCode::INT32: |
|
| 38 | + case TypeCode::INT64: |
|
| 39 | + case TypeCode::DOUBLE: |
|
| 40 | + case TypeCode::DECIMAL: |
|
| 41 | + return true; |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | return false; |
@@ -30,15 +30,15 @@ |
||
| 30 | 30 | public function isCompatibleWith(IType $type) |
| 31 | 31 | { |
| 32 | 32 | switch ($type->getTypeCode()) { |
| 33 | - case TypeCode::BYTE: |
|
| 34 | - case TypeCode::SBYTE: |
|
| 35 | - case TypeCode::INT16: |
|
| 36 | - case TypeCode::INT32: |
|
| 37 | - case TypeCode::INT64: |
|
| 38 | - case TypeCode::SINGLE: |
|
| 39 | - case TypeCode::DOUBLE: |
|
| 40 | - return true; |
|
| 41 | - } |
|
| 33 | + case TypeCode::BYTE: |
|
| 34 | + case TypeCode::SBYTE: |
|
| 35 | + case TypeCode::INT16: |
|
| 36 | + case TypeCode::INT32: |
|
| 37 | + case TypeCode::INT64: |
|
| 38 | + case TypeCode::SINGLE: |
|
| 39 | + case TypeCode::DOUBLE: |
|
| 40 | + return true; |
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | 43 | return false; |
| 44 | 44 | } |
@@ -30,10 +30,10 @@ |
||
| 30 | 30 | public function isCompatibleWith(IType $type) |
| 31 | 31 | { |
| 32 | 32 | switch ($type->getTypeCode()) { |
| 33 | - case TypeCode::BYTE: |
|
| 34 | - case TypeCode::SBYTE: |
|
| 35 | - case TypeCode::INT16: |
|
| 36 | - return true; |
|
| 33 | + case TypeCode::BYTE: |
|
| 34 | + case TypeCode::SBYTE: |
|
| 35 | + case TypeCode::INT16: |
|
| 36 | + return true; |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | return false; |
@@ -30,11 +30,11 @@ |
||
| 30 | 30 | public function isCompatibleWith(IType $type) |
| 31 | 31 | { |
| 32 | 32 | switch ($type->getTypeCode()) { |
| 33 | - case TypeCode::BYTE: |
|
| 34 | - case TypeCode::SBYTE: |
|
| 35 | - case TypeCode::INT16: |
|
| 36 | - case TypeCode::INT32: |
|
| 37 | - return true; |
|
| 33 | + case TypeCode::BYTE: |
|
| 34 | + case TypeCode::SBYTE: |
|
| 35 | + case TypeCode::INT16: |
|
| 36 | + case TypeCode::INT32: |
|
| 37 | + return true; |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | return false; |
@@ -30,12 +30,12 @@ |
||
| 30 | 30 | public function isCompatibleWith(IType $type) |
| 31 | 31 | { |
| 32 | 32 | switch ($type->getTypeCode()) { |
| 33 | - case TypeCode::BYTE: |
|
| 34 | - case TypeCode::SBYTE: |
|
| 35 | - case TypeCode::INT16: |
|
| 36 | - case TypeCode::INT32: |
|
| 37 | - case TypeCode::INT64: |
|
| 38 | - return true; |
|
| 33 | + case TypeCode::BYTE: |
|
| 34 | + case TypeCode::SBYTE: |
|
| 35 | + case TypeCode::INT16: |
|
| 36 | + case TypeCode::INT32: |
|
| 37 | + case TypeCode::INT64: |
|
| 38 | + return true; |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | return false; |
@@ -31,13 +31,13 @@ |
||
| 31 | 31 | public function isCompatibleWith(IType $type) |
| 32 | 32 | { |
| 33 | 33 | switch ($type->getTypeCode()) { |
| 34 | - case TypeCode::BYTE: |
|
| 35 | - case TypeCode::SBYTE: |
|
| 36 | - case TypeCode::INT16: |
|
| 37 | - case TypeCode::INT32: |
|
| 38 | - case TypeCode::INT64: |
|
| 39 | - case TypeCode::SINGLE: |
|
| 40 | - return true; |
|
| 34 | + case TypeCode::BYTE: |
|
| 35 | + case TypeCode::SBYTE: |
|
| 36 | + case TypeCode::INT16: |
|
| 37 | + case TypeCode::INT32: |
|
| 38 | + case TypeCode::INT64: |
|
| 39 | + case TypeCode::SINGLE: |
|
| 40 | + return true; |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | return false; |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | $resourceSetWrappers = array(); |
| 178 | 178 | $resourceSetNames = array(); |
| 179 | 179 | foreach ($resourceSets as $resourceSet) { |
| 180 | - $name = $resourceSet->getName(); |
|
| 180 | + $name = $resourceSet->getName(); |
|
| 181 | 181 | if (in_array($name, $resourceSetNames)) { |
| 182 | 182 | throw new ODataException(Messages::providersWrapperEntitySetNameShouldBeUnique($name), 500 ); |
| 183 | 183 | } |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | public function resolveResourceSet($name) |
| 232 | 232 | { |
| 233 | 233 | if (array_key_exists($name, $this->setWrapperCache)) { |
| 234 | - return $this->setWrapperCache[$name]; |
|
| 234 | + return $this->setWrapperCache[$name]; |
|
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | $resourceSet = $this->metaProvider->resolveResourceSet($name); |
@@ -280,9 +280,9 @@ discard block |
||
| 280 | 280 | public function getDerivedTypes(ResourceType $resourceType) |
| 281 | 281 | { |
| 282 | 282 | $derivedTypes = $this->metaProvider->getDerivedTypes($resourceType); |
| 283 | - if (!is_array($derivedTypes)) { |
|
| 284 | - throw new InvalidOperationException(Messages::metadataAssociationTypeSetInvalidGetDerivedTypesReturnType($resourceType->getName())); |
|
| 285 | - } |
|
| 283 | + if (!is_array($derivedTypes)) { |
|
| 284 | + throw new InvalidOperationException(Messages::metadataAssociationTypeSetInvalidGetDerivedTypesReturnType($resourceType->getName())); |
|
| 285 | + } |
|
| 286 | 286 | |
| 287 | 287 | foreach ($derivedTypes as $derivedType) { |
| 288 | 288 | $this->_validateResourceType($derivedType); |
@@ -326,7 +326,7 @@ discard block |
||
| 326 | 326 | * other end of the association is invisible |
| 327 | 327 | */ |
| 328 | 328 | public function getResourceAssociationSet( |
| 329 | - ResourceSet $set, |
|
| 329 | + ResourceSet $set, |
|
| 330 | 330 | ResourceType $type, |
| 331 | 331 | ResourceProperty $property |
| 332 | 332 | ) { |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | |
| 346 | 346 | if (!is_null($associationSet)) { |
| 347 | 347 | $thisAssociationSetEnd = $associationSet->getResourceAssociationSetEnd( |
| 348 | - $set, |
|
| 348 | + $set, |
|
| 349 | 349 | $type, |
| 350 | 350 | $property |
| 351 | 351 | ); |
@@ -438,26 +438,26 @@ discard block |
||
| 438 | 438 | */ |
| 439 | 439 | public function getResourceProperties(ResourceSetWrapper $setWrapper, ResourceType $resourceType) { |
| 440 | 440 | if ($resourceType->getResourceTypeKind() != ResourceTypeKind::ENTITY) { |
| 441 | - //Complex resource type |
|
| 442 | - return $resourceType->getAllProperties(); |
|
| 441 | + //Complex resource type |
|
| 442 | + return $resourceType->getAllProperties(); |
|
| 443 | 443 | } |
| 444 | - //TODO: move this to doctrine annotations |
|
| 445 | - $cacheKey = $setWrapper->getName() . '_' . $resourceType->getFullName(); |
|
| 444 | + //TODO: move this to doctrine annotations |
|
| 445 | + $cacheKey = $setWrapper->getName() . '_' . $resourceType->getFullName(); |
|
| 446 | 446 | if (!array_key_exists($cacheKey, $this->propertyCache)) { |
| 447 | - //Fill the cache |
|
| 448 | - $this->propertyCache[$cacheKey] = array(); |
|
| 449 | - foreach ($resourceType->getAllProperties() as $resourceProperty) { |
|
| 450 | - //Check whether this is a visible navigation property |
|
| 451 | - //TODO: is this broken?? see #87 |
|
| 452 | - if ($resourceProperty->getTypeKind() == ResourceTypeKind::ENTITY |
|
| 453 | - && !is_null($this->getResourceSetWrapperForNavigationProperty($setWrapper, $resourceType, $resourceProperty)) |
|
| 454 | - ) { |
|
| 455 | - $this->propertyCache[$cacheKey][$resourceProperty->getName()] = $resourceProperty; |
|
| 456 | - } else { |
|
| 457 | - //primitive, bag or complex property |
|
| 458 | - $this->propertyCache[$cacheKey][$resourceProperty->getName()] = $resourceProperty; |
|
| 459 | - } |
|
| 460 | - } |
|
| 447 | + //Fill the cache |
|
| 448 | + $this->propertyCache[$cacheKey] = array(); |
|
| 449 | + foreach ($resourceType->getAllProperties() as $resourceProperty) { |
|
| 450 | + //Check whether this is a visible navigation property |
|
| 451 | + //TODO: is this broken?? see #87 |
|
| 452 | + if ($resourceProperty->getTypeKind() == ResourceTypeKind::ENTITY |
|
| 453 | + && !is_null($this->getResourceSetWrapperForNavigationProperty($setWrapper, $resourceType, $resourceProperty)) |
|
| 454 | + ) { |
|
| 455 | + $this->propertyCache[$cacheKey][$resourceProperty->getName()] = $resourceProperty; |
|
| 456 | + } else { |
|
| 457 | + //primitive, bag or complex property |
|
| 458 | + $this->propertyCache[$cacheKey][$resourceProperty->getName()] = $resourceProperty; |
|
| 459 | + } |
|
| 460 | + } |
|
| 461 | 461 | } |
| 462 | 462 | return $this->propertyCache[$cacheKey]; |
| 463 | 463 | |
@@ -579,30 +579,30 @@ discard block |
||
| 579 | 579 | */ |
| 580 | 580 | public function getExpressionProvider() |
| 581 | 581 | { |
| 582 | - $expressionProvider = $this->queryProvider->getExpressionProvider(); |
|
| 582 | + $expressionProvider = $this->queryProvider->getExpressionProvider(); |
|
| 583 | 583 | if (is_null($expressionProvider)) { |
| 584 | 584 | throw ODataException::createInternalServerError(Messages::providersWrapperExpressionProviderMustNotBeNullOrEmpty()); |
| 585 | 585 | } |
| 586 | 586 | |
| 587 | 587 | if (!$expressionProvider instanceof IExpressionProvider) |
| 588 | 588 | { |
| 589 | - throw ODataException::createInternalServerError( Messages::providersWrapperInvalidExpressionProviderInstance() ); |
|
| 589 | + throw ODataException::createInternalServerError( Messages::providersWrapperInvalidExpressionProviderInstance() ); |
|
| 590 | 590 | } |
| 591 | 591 | |
| 592 | 592 | return $expressionProvider; |
| 593 | 593 | } |
| 594 | 594 | |
| 595 | - /** |
|
| 596 | - * Indicates if the QueryProvider can handle ordered paging, this means respecting order, skip, and top parameters |
|
| 597 | - * If the query provider can not handle ordered paging, it must return the entire result set and POData will |
|
| 598 | - * perform the ordering and paging |
|
| 599 | - * |
|
| 600 | - * @return Boolean True if the query provider can handle ordered paging, false if POData should perform the paging |
|
| 601 | - */ |
|
| 602 | - public function handlesOrderedPaging() |
|
| 603 | - { |
|
| 604 | - return $this->queryProvider->handlesOrderedPaging(); |
|
| 605 | - } |
|
| 595 | + /** |
|
| 596 | + * Indicates if the QueryProvider can handle ordered paging, this means respecting order, skip, and top parameters |
|
| 597 | + * If the query provider can not handle ordered paging, it must return the entire result set and POData will |
|
| 598 | + * perform the ordering and paging |
|
| 599 | + * |
|
| 600 | + * @return Boolean True if the query provider can handle ordered paging, false if POData should perform the paging |
|
| 601 | + */ |
|
| 602 | + public function handlesOrderedPaging() |
|
| 603 | + { |
|
| 604 | + return $this->queryProvider->handlesOrderedPaging(); |
|
| 605 | + } |
|
| 606 | 606 | |
| 607 | 607 | |
| 608 | 608 | private function ValidateQueryResult($queryResult, QueryType $queryType, $methodName){ |
@@ -650,14 +650,14 @@ discard block |
||
| 650 | 650 | public function getResourceSet(QueryType $queryType, ResourceSet $resourceSet, $filterInfo, $orderBy, $top, $skip) |
| 651 | 651 | { |
| 652 | 652 | |
| 653 | - $queryResult = $this->queryProvider->getResourceSet( |
|
| 654 | - $queryType, |
|
| 655 | - $resourceSet, |
|
| 656 | - $filterInfo, |
|
| 657 | - $orderBy, |
|
| 658 | - $top, |
|
| 659 | - $skip |
|
| 660 | - ); |
|
| 653 | + $queryResult = $this->queryProvider->getResourceSet( |
|
| 654 | + $queryType, |
|
| 655 | + $resourceSet, |
|
| 656 | + $filterInfo, |
|
| 657 | + $orderBy, |
|
| 658 | + $top, |
|
| 659 | + $skip |
|
| 660 | + ); |
|
| 661 | 661 | |
| 662 | 662 | $this->validateQueryResult($queryResult, $queryType, 'IQueryProvider::getResourceSet'); |
| 663 | 663 | |
@@ -703,10 +703,10 @@ discard block |
||
| 703 | 703 | * |
| 704 | 704 | * @throws ODataException |
| 705 | 705 | */ |
| 706 | - public function getRelatedResourceSet( |
|
| 707 | - QueryType $queryType, |
|
| 708 | - ResourceSet $sourceResourceSet, |
|
| 709 | - $sourceEntity, |
|
| 706 | + public function getRelatedResourceSet( |
|
| 707 | + QueryType $queryType, |
|
| 708 | + ResourceSet $sourceResourceSet, |
|
| 709 | + $sourceEntity, |
|
| 710 | 710 | ResourceSet $targetResourceSet, |
| 711 | 711 | ResourceProperty $targetProperty, |
| 712 | 712 | $filterInfo, |
@@ -715,17 +715,17 @@ discard block |
||
| 715 | 715 | $skip |
| 716 | 716 | ) { |
| 717 | 717 | |
| 718 | - $queryResult = $this->queryProvider->getRelatedResourceSet( |
|
| 719 | - $queryType, |
|
| 720 | - $sourceResourceSet, |
|
| 721 | - $sourceEntity, |
|
| 722 | - $targetResourceSet, |
|
| 723 | - $targetProperty, |
|
| 724 | - $filterInfo, |
|
| 725 | - $orderBy, |
|
| 726 | - $top, |
|
| 727 | - $skip |
|
| 728 | - ); |
|
| 718 | + $queryResult = $this->queryProvider->getRelatedResourceSet( |
|
| 719 | + $queryType, |
|
| 720 | + $sourceResourceSet, |
|
| 721 | + $sourceEntity, |
|
| 722 | + $targetResourceSet, |
|
| 723 | + $targetProperty, |
|
| 724 | + $filterInfo, |
|
| 725 | + $orderBy, |
|
| 726 | + $top, |
|
| 727 | + $skip |
|
| 728 | + ); |
|
| 729 | 729 | |
| 730 | 730 | |
| 731 | 731 | $this->validateQueryResult($queryResult, $queryType, 'IQueryProvider::getRelatedResourceSet'); |
@@ -751,14 +751,14 @@ discard block |
||
| 751 | 751 | KeyDescriptor $keyDescriptor |
| 752 | 752 | ) { |
| 753 | 753 | $entityInstance = $this->queryProvider->getResourceFromRelatedResourceSet( |
| 754 | - $sourceResourceSet, |
|
| 755 | - $sourceEntity, |
|
| 756 | - $targetResourceSet, |
|
| 757 | - $targetProperty, |
|
| 758 | - $keyDescriptor |
|
| 759 | - ); |
|
| 760 | - |
|
| 761 | - $this->_validateEntityInstance( |
|
| 754 | + $sourceResourceSet, |
|
| 755 | + $sourceEntity, |
|
| 756 | + $targetResourceSet, |
|
| 757 | + $targetProperty, |
|
| 758 | + $keyDescriptor |
|
| 759 | + ); |
|
| 760 | + |
|
| 761 | + $this->_validateEntityInstance( |
|
| 762 | 762 | $entityInstance, $targetResourceSet, |
| 763 | 763 | $keyDescriptor, |
| 764 | 764 | 'IQueryProvider::getResourceFromRelatedResourceSet' |
@@ -913,8 +913,8 @@ discard block |
||
| 913 | 913 | */ |
| 914 | 914 | protected function assert($condition, $conditionAsString) |
| 915 | 915 | { |
| 916 | - if (!$condition) { |
|
| 917 | - throw new InvalidOperationException("Unexpected state, expecting $conditionAsString"); |
|
| 918 | - } |
|
| 916 | + if (!$condition) { |
|
| 917 | + throw new InvalidOperationException("Unexpected state, expecting $conditionAsString"); |
|
| 918 | + } |
|
| 919 | 919 | } |
| 920 | 920 | } |
| 921 | 921 | \ No newline at end of file |
@@ -16,45 +16,45 @@ discard block |
||
| 16 | 16 | interface IQueryProvider |
| 17 | 17 | { |
| 18 | 18 | |
| 19 | - /** |
|
| 20 | - * Indicates if the QueryProvider can handle ordered paging, this means respecting order, skip, and top parameters |
|
| 21 | - * If the query provider can not handle ordered paging, it must return the entire result set and POData will |
|
| 22 | - * perform the ordering and paging |
|
| 23 | - * |
|
| 24 | - * @return Boolean True if the query provider can handle ordered paging, false if POData should perform the paging |
|
| 25 | - */ |
|
| 26 | - public function handlesOrderedPaging(); |
|
| 27 | - |
|
| 28 | - /** |
|
| 29 | - * Gets the expression provider used by to compile OData expressions into expression used by this query provider. |
|
| 30 | - * |
|
| 31 | - * @return IExpressionProvider |
|
| 32 | - */ |
|
| 33 | - public function getExpressionProvider(); |
|
| 34 | - |
|
| 35 | - |
|
| 36 | - /** |
|
| 37 | - * Gets collection of entities belongs to an entity set |
|
| 38 | - * IE: http://host/EntitySet |
|
| 39 | - * http://host/EntitySet?$skip=10&$top=5&filter=Prop gt Value |
|
| 40 | - * |
|
| 41 | - * @param QueryType $queryType indicates if this is a query for a count, entities, or entities with a count |
|
| 42 | - * @param ResourceSet $resourceSet The entity set containing the entities to fetch |
|
| 43 | - * @param FilterInfo $filterInfo represents the $filter parameter of the OData query. NULL if no $filter specified |
|
| 44 | - * @param mixed $orderBy sorted order if we want to get the data in some specific order |
|
| 45 | - * @param int $top number of records which need to be skip |
|
| 46 | - * @param String $skipToken value indicating what records to skip |
|
| 47 | - * |
|
| 48 | - * @return QueryResult |
|
| 49 | - */ |
|
| 50 | - public function getResourceSet( |
|
| 51 | - QueryType $queryType, |
|
| 52 | - ResourceSet $resourceSet, |
|
| 53 | - $filterInfo = null, |
|
| 54 | - $orderBy = null, |
|
| 55 | - $top = null, |
|
| 56 | - $skipToken = null |
|
| 57 | - ); |
|
| 19 | + /** |
|
| 20 | + * Indicates if the QueryProvider can handle ordered paging, this means respecting order, skip, and top parameters |
|
| 21 | + * If the query provider can not handle ordered paging, it must return the entire result set and POData will |
|
| 22 | + * perform the ordering and paging |
|
| 23 | + * |
|
| 24 | + * @return Boolean True if the query provider can handle ordered paging, false if POData should perform the paging |
|
| 25 | + */ |
|
| 26 | + public function handlesOrderedPaging(); |
|
| 27 | + |
|
| 28 | + /** |
|
| 29 | + * Gets the expression provider used by to compile OData expressions into expression used by this query provider. |
|
| 30 | + * |
|
| 31 | + * @return IExpressionProvider |
|
| 32 | + */ |
|
| 33 | + public function getExpressionProvider(); |
|
| 34 | + |
|
| 35 | + |
|
| 36 | + /** |
|
| 37 | + * Gets collection of entities belongs to an entity set |
|
| 38 | + * IE: http://host/EntitySet |
|
| 39 | + * http://host/EntitySet?$skip=10&$top=5&filter=Prop gt Value |
|
| 40 | + * |
|
| 41 | + * @param QueryType $queryType indicates if this is a query for a count, entities, or entities with a count |
|
| 42 | + * @param ResourceSet $resourceSet The entity set containing the entities to fetch |
|
| 43 | + * @param FilterInfo $filterInfo represents the $filter parameter of the OData query. NULL if no $filter specified |
|
| 44 | + * @param mixed $orderBy sorted order if we want to get the data in some specific order |
|
| 45 | + * @param int $top number of records which need to be skip |
|
| 46 | + * @param String $skipToken value indicating what records to skip |
|
| 47 | + * |
|
| 48 | + * @return QueryResult |
|
| 49 | + */ |
|
| 50 | + public function getResourceSet( |
|
| 51 | + QueryType $queryType, |
|
| 52 | + ResourceSet $resourceSet, |
|
| 53 | + $filterInfo = null, |
|
| 54 | + $orderBy = null, |
|
| 55 | + $top = null, |
|
| 56 | + $skipToken = null |
|
| 57 | + ); |
|
| 58 | 58 | |
| 59 | 59 | |
| 60 | 60 | /** |
@@ -68,40 +68,40 @@ discard block |
||
| 68 | 68 | * @return object|null Returns entity instance if found else null |
| 69 | 69 | */ |
| 70 | 70 | public function getResourceFromResourceSet( |
| 71 | - ResourceSet $resourceSet, |
|
| 71 | + ResourceSet $resourceSet, |
|
| 72 | 72 | KeyDescriptor $keyDescriptor |
| 73 | 73 | ); |
| 74 | 74 | |
| 75 | 75 | |
| 76 | - /** |
|
| 77 | - * Get related resource set for a resource |
|
| 78 | - * IE: http://host/EntitySet(1L)/NavigationPropertyToCollection |
|
| 79 | - * http://host/EntitySet?$expand=NavigationPropertyToCollection |
|
| 80 | - * |
|
| 81 | - * @param QueryType $queryType indicates if this is a query for a count, entities, or entities with a count |
|
| 82 | - * @param ResourceSet $sourceResourceSet The entity set containing the source entity |
|
| 83 | - * @param object $sourceEntityInstance The source entity instance. |
|
| 84 | - * @param ResourceSet $targetResourceSet The resource set of containing the target of the navigation property |
|
| 85 | - * @param ResourceProperty $targetProperty The navigation property to retrieve |
|
| 86 | - * @param FilterInfo $filter represents the $filter parameter of the OData query. NULL if no $filter specified |
|
| 87 | - * @param mixed $orderBy sorted order if we want to get the data in some specific order |
|
| 88 | - * @param int $top number of records which need to be skip |
|
| 89 | - * @param String $skip value indicating what records to skip |
|
| 90 | - * |
|
| 91 | - * @return QueryResult |
|
| 92 | - * |
|
| 93 | - */ |
|
| 94 | - public function getRelatedResourceSet( |
|
| 95 | - QueryType $queryType, |
|
| 96 | - ResourceSet $sourceResourceSet, |
|
| 97 | - $sourceEntityInstance, |
|
| 98 | - ResourceSet $targetResourceSet, |
|
| 99 | - ResourceProperty $targetProperty, |
|
| 100 | - $filter = null, |
|
| 101 | - $orderBy = null, |
|
| 102 | - $top = null, |
|
| 103 | - $skip = null |
|
| 104 | - ); |
|
| 76 | + /** |
|
| 77 | + * Get related resource set for a resource |
|
| 78 | + * IE: http://host/EntitySet(1L)/NavigationPropertyToCollection |
|
| 79 | + * http://host/EntitySet?$expand=NavigationPropertyToCollection |
|
| 80 | + * |
|
| 81 | + * @param QueryType $queryType indicates if this is a query for a count, entities, or entities with a count |
|
| 82 | + * @param ResourceSet $sourceResourceSet The entity set containing the source entity |
|
| 83 | + * @param object $sourceEntityInstance The source entity instance. |
|
| 84 | + * @param ResourceSet $targetResourceSet The resource set of containing the target of the navigation property |
|
| 85 | + * @param ResourceProperty $targetProperty The navigation property to retrieve |
|
| 86 | + * @param FilterInfo $filter represents the $filter parameter of the OData query. NULL if no $filter specified |
|
| 87 | + * @param mixed $orderBy sorted order if we want to get the data in some specific order |
|
| 88 | + * @param int $top number of records which need to be skip |
|
| 89 | + * @param String $skip value indicating what records to skip |
|
| 90 | + * |
|
| 91 | + * @return QueryResult |
|
| 92 | + * |
|
| 93 | + */ |
|
| 94 | + public function getRelatedResourceSet( |
|
| 95 | + QueryType $queryType, |
|
| 96 | + ResourceSet $sourceResourceSet, |
|
| 97 | + $sourceEntityInstance, |
|
| 98 | + ResourceSet $targetResourceSet, |
|
| 99 | + ResourceProperty $targetProperty, |
|
| 100 | + $filter = null, |
|
| 101 | + $orderBy = null, |
|
| 102 | + $top = null, |
|
| 103 | + $skip = null |
|
| 104 | + ); |
|
| 105 | 105 | |
| 106 | 106 | /** |
| 107 | 107 | * Gets a related entity instance from an entity set identified by a key |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | * @return object|null Returns entity instance if found else null |
| 117 | 117 | */ |
| 118 | 118 | public function getResourceFromRelatedResourceSet( |
| 119 | - ResourceSet $sourceResourceSet, |
|
| 119 | + ResourceSet $sourceResourceSet, |
|
| 120 | 120 | $sourceEntityInstance, |
| 121 | 121 | ResourceSet $targetResourceSet, |
| 122 | 122 | ResourceProperty $targetProperty, |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | * @return object|null The related resource if found else null |
| 140 | 140 | */ |
| 141 | 141 | public function getRelatedResourceReference( |
| 142 | - ResourceSet $sourceResourceSet, |
|
| 142 | + ResourceSet $sourceResourceSet, |
|
| 143 | 143 | $sourceEntityInstance, |
| 144 | 144 | ResourceSet $targetResourceSet, |
| 145 | 145 | ResourceProperty $targetProperty |