@@ -61,11 +61,11 @@ public function __construct($dependentEntities = null)
61
61
* @param EntityDataObject $entityObject
62
62
* @param array $operationMetadata
63
63
* @param string $operation
64
- * @param integer $depth
64
+ * @param bool $fromArray
65
65
* @return array
66
66
* @throws \Exception
67
67
*/
68
- public function resolveOperationDataArray ($ entityObject , $ operationMetadata , $ operation , $ depth = 0 )
68
+ public function resolveOperationDataArray ($ entityObject , $ operationMetadata , $ operation , $ fromArray = false )
69
69
{
70
70
$ operationDataArray = [];
71
71
self ::incrementSequence ($ entityObject ->getName ());
@@ -87,9 +87,9 @@ public function resolveOperationDataArray($entityObject, $operationMetadata, $op
87
87
$ entityObj ,
88
88
$ operationElement ->getNestedMetadata (),
89
89
$ operation ,
90
- $ depth + 1
90
+ $ fromArray
91
91
);
92
- if ($ depth == 0 ) {
92
+ if (! $ fromArray ) {
93
93
$ operationDataArray [$ operationElement ->getKey ()] = $ operationData ;
94
94
} else {
95
95
$ operationDataArray = $ operationData ;
@@ -148,7 +148,7 @@ public function resolveOperationDataArray($entityObject, $operationMetadata, $op
148
148
$ entityName ,
149
149
$ operationElement ,
150
150
$ operation ,
151
- $ depth
151
+ $ fromArray
152
152
);
153
153
154
154
if ($ operationElement ->getType () == OperationDefinitionObjectHandler::ENTITY_OPERATION_ARRAY ) {
@@ -254,10 +254,10 @@ private function resolveOperationObjectAndEntityData($entityObject, $operationEl
254
254
* @param string $entityName
255
255
* @param OperationElement $operationElement
256
256
* @param string $operation
257
- * @param integer $depth
257
+ * @param bool $fromArray
258
258
* @return array
259
259
*/
260
- private function resolveNonPrimitiveElement ($ entityName , $ operationElement , $ operation , $ depth )
260
+ private function resolveNonPrimitiveElement ($ entityName , $ operationElement , $ operation , $ fromArray = false )
261
261
{
262
262
$ linkedEntityObj = $ this ->resolveLinkedEntityObject ($ entityName );
263
263
@@ -269,7 +269,7 @@ private function resolveNonPrimitiveElement($entityName, $operationElement, $ope
269
269
$ linkedEntityObj ,
270
270
[$ operationElement ->getNestedOperationElement ($ operationElement ->getValue ())],
271
271
$ operation ,
272
- $ depth + 1
272
+ true
273
273
);
274
274
275
275
return $ operationSubArray ;
@@ -280,7 +280,7 @@ private function resolveNonPrimitiveElement($entityName, $operationElement, $ope
280
280
$ linkedEntityObj ->getType ()
281
281
)->getOperationMetadata ();
282
282
283
- return $ this ->resolveOperationDataArray ($ linkedEntityObj , $ operationMetadata , $ operation );
283
+ return $ this ->resolveOperationDataArray ($ linkedEntityObj , $ operationMetadata , $ operation, $ fromArray );
284
284
}
285
285
286
286
/**
0 commit comments