src/Graviton/DocumentBundle/DependencyInjection/Compiler/Utils/DocumentMap.php
private function getRelationList($mapping, $suffix)
    {
        if (!isset($mapping['embed'.$suffix]) && !isset($mapping['reference'.$suffix])) {
            return [];
        }

        $relations = [];
        if (isset($mapping['embed'.$suffix])) {
            $relations = array_merge($relations, $mapping['embed'.$suffix]);
        }
        if (isset($mapping['reference'.$suffix])) {
            $relations = array_merge($relations, $mapping['reference'.$suffix]);
        }

        return array_map(
            function ($key, $value) {
                return [
                    'name' => $key,
                    'type' => $value['targetDocument']
                ];
            },
            array_keys($relations),
            $relations
        );
    }
private function getRelationList($mapping, $suffix)
    {
        if (!isset($mapping['embed'.$suffix]) && !isset($mapping['reference'.$suffix])) {
            return [];
        }

        $relations = [];
        if (isset($mapping['embed'.$suffix])) {
            $relations = array_merge($relations, $mapping['embed'.$suffix]);
        }
        if (isset($mapping['reference'.$suffix])) {
            $relations = array_merge($relations, $mapping['reference'.$suffix]);
        }

        return array_map(
            function ($key, $value) {
                return [
                    'name' => $key,
                    'type' => $value['targetDocument']
                ];
            },
            array_keys($relations),
            $relations
        );
    }
private function getRelationList ( $ mapping , $ suffix ) { if ( ! isset ( $ mapping [ 'embed' . $ suffix ] ) && ! isset ( $ mapping [ 'reference' . $ suffix ] ) ) { return [ ] ; } $ relations = [ ] ; if ( isset ( $ mapping [ 'embed' . $ suffix ] ) ) { $ relations = array_merge ( $ relations , $ mapping [ 'embed' . $ suffix ] ) ; } if ( isset ( $ mapping [ 'reference' . $ suffix ] ) ) { $ relations = array_merge ( $ relations , $ mapping [ 'reference' . $ suffix ] ) ; } return array_map ( function ( $ key , $ value ) { return [ 'name' => $ key , 'type' => $ value [ 'targetDocument' ] ] ; } , array_keys ( $ relations ) , $ relations ) ; }
gets list of relations

@param array  $mapping mapping
@param string $suffix  suffix

@return array relations
gets list of relations