@@ -134,6 +134,14 @@ public function resolveOperationDataArray($entityObject, $operationMetadata, $op
134
134
));
135
135
}
136
136
} else {
137
+
138
+ $ operationElementProperty = null ;
139
+ if (strpos ($ operationElementType , '. ' ) !== false ){
140
+ $ operationElementComponents = explode ('. ' ,$ operationElementType );
141
+ $ operationElementType = $ operationElementComponents [0 ];
142
+ $ operationElementProperty = $ operationElementComponents [1 ];
143
+ }
144
+
137
145
$ entityNamesOfType = $ entityObject ->getLinkedEntitiesOfType ($ operationElementType );
138
146
139
147
// If an element is required by metadata, but was not provided in the entity, throw an exception
@@ -146,12 +154,23 @@ public function resolveOperationDataArray($entityObject, $operationMetadata, $op
146
154
));
147
155
}
148
156
foreach ($ entityNamesOfType as $ entityName ) {
149
- $ operationDataSubArray = $ this ->resolveNonPrimitiveElement (
150
- $ entityName ,
151
- $ operationElement ,
152
- $ operation ,
153
- $ fromArray
154
- );
157
+
158
+ if ($ operationElementProperty === null ) {
159
+ $ operationDataSubArray = $ this ->resolveNonPrimitiveElement (
160
+ $ entityName ,
161
+ $ operationElement ,
162
+ $ operation ,
163
+ $ fromArray
164
+ );
165
+ }else {
166
+ $ linkedEntityObj = $ this ->resolveLinkedEntityObject ($ entityName );
167
+ $ operationDataSubArray = $ linkedEntityObj ->getDataByName ($ operationElementProperty ,0 );
168
+
169
+ if ($ operationDataSubArray === null )
170
+ throw new \Exception (
171
+ sprintf ('Property %s not found in entity %s \n ' , $ operationElementProperty , $ entityName )
172
+ );
173
+ }
155
174
156
175
if ($ operationElement ->getType () == OperationDefinitionObjectHandler::ENTITY_OPERATION_ARRAY ) {
157
176
$ operationDataArray [$ operationElement ->getKey ()][] = $ operationDataSubArray ;
0 commit comments