|
@@ -538,7 +538,7 @@ discard block |
|
|
block discarded – undo |
|
538
|
538
|
) { |
|
539
|
539
|
if (!($sourceResourcePropertyKind == ResourcePropertyKind::RESOURCESET_REFERENCE |
|
540
|
540
|
|| $targetResourcePropertyKind == ResourcePropertyKind::RESOURCE_REFERENCE) |
|
541
|
|
- && !($sourceResourcePropertyKind == ResourcePropertyKind::RESOURCESET_REFERENCE |
|
|
541
|
+ && !($sourceResourcePropertyKind == ResourcePropertyKind::RESOURCESET_REFERENCE |
|
542
|
542
|
|| $targetResourcePropertyKind == ResourcePropertyKind::RESOURCE_REFERENCE) |
|
543
|
543
|
) { |
|
544
|
544
|
throw new InvalidOperationException( |
|
@@ -552,25 +552,25 @@ discard block |
|
|
block discarded – undo |
|
552
|
552
|
$this->checkInstanceProperty($targetPropertyName, $targetResourceType); |
|
553
|
553
|
// check that property and resource name don't up and collide - would violate OData spec |
|
554
|
554
|
if (strtolower($sourcePropertyName) == strtolower($sourceResourceType->getName()) |
|
555
|
|
- || strtolower($targetResourceType) == strtolower($targetResourceType->getName()) |
|
556
|
|
- ) { |
|
|
555
|
+ || strtolower($targetResourceType) == strtolower($targetResourceType->getName()) |
|
|
556
|
+ ) { |
|
557
|
557
|
throw new InvalidOperationException( |
|
558
|
558
|
'Property name must be different from resource name.' |
|
559
|
559
|
); |
|
560
|
560
|
} |
|
561
|
561
|
|
|
562
|
|
- $sourceResourceProperty = new ResourceProperty($sourcePropertyName, null, $sourceResourcePropertyKind, $sourceResourceType); |
|
|
562
|
+ $sourceResourceProperty = new ResourceProperty($sourcePropertyName, null, $sourceResourcePropertyKind, $sourceResourceType); |
|
563
|
563
|
$targetResourceProperty = new ResourceProperty($targetPropertyName, null, $targetResourcePropertyKind, $targetResourceType); |
|
564
|
564
|
|
|
565
|
565
|
$sourceResourceType->addProperty($sourceResourceProperty); |
|
566
|
|
- $targetResourceType->addProperty($targetResourceProperty); |
|
|
566
|
+ $targetResourceType->addProperty($targetResourceProperty); |
|
567
|
567
|
|
|
568
|
568
|
|
|
569
|
569
|
//Customer_Orders_Orders, Order_Customer_Customers |
|
570
|
570
|
//(source type::name _ source property::name _ target set::name) |
|
571
|
571
|
$setKey = ResourceAssociationSet::keyName($sourceResourceType->getName(), $sourcePropertyName, $targetResourceType->getName(), $targetPropertyName); |
|
572
|
572
|
//$setKey = $resourceType->getName() . '_' . $name . '_' . $targetResourceType->getName(); |
|
573
|
|
- $set = new ResourceAssociationSet( |
|
|
573
|
+ $set = new ResourceAssociationSet( |
|
574
|
574
|
$setKey, |
|
575
|
575
|
new ResourceAssociationSetEnd($sourceResourceSet, $sourceResourceType, $sourceResourceProperty), |
|
576
|
576
|
new ResourceAssociationSetEnd($targetResourceSet, $targetResourceType, $targetResourceProperty) |