protected function calculateFieldPaths(array $structure, $firstLevelFieldName = null)
{
$fieldPaths = [];
if (is_array($structure)) {
foreach ($structure as $key => $subStructure) {
$fieldPath = ($firstLevelFieldName !== null ? $firstLevelFieldName . '/' : '') . $key;
if (is_array($subStructure)) {
foreach ($this->calculateFieldPaths($subStructure) as $subFieldPath) {
$fieldPaths[] = $fieldPath . '/' . $subFieldPath;
}
} else {
$fieldPaths[] = $fieldPath;
}
}
}
return $fieldPaths;
}