private function getDoctrineFields(array $mapping)
    {
        if (!isset($mapping['fields'])) {
            return [];
        }

        return array_map(
            function ($key, $value) {
                if (!isset($value['type'])) {
                    $value['type'] = '';
                }

                return [
                    'name' => $key,
                    'type' => $value['type']
                ];
            },
            array_keys($mapping['fields']),
            $mapping['fields']
        );
    }