CodeExplorer updateRecursive example
$parent =
$this->
loadParents( Uuid::
fromHexToBytes($parentId),
$definition,
Uuid::
fromHexToBytes($context->
getVersionId()) );
if ($parent ===
[]) { return [];
} return $this->
updateRecursive($parent,
$definition,
$context);
} private function updateRecursive(array
$entity, EntityDefinition
$definition, Context
$context): array
{ $ids =
[];
$ids[] =
$this->
updateTree($entity,
$definition,
$context);
foreach ($this->
getChildren($entity,
$definition,
$context) as $child) { $child['parent'
] =
$entity;
$child['parentCount'
] =
$entity['parentCount'
] + 1;
$ids =
array_merge($ids,
$this->
updateRecursive($child,
$definition,
$context));
}