src/Graviton/DocumentBundle/DependencyInjection/Compiler/TranslatableFieldsCompilerPass.php
public function process(ContainerBuilder $container)
    {
        $this->documentMap = $container->get('graviton.document.map');
        $map = [];
        foreach ($this->documentMap->getDocuments() as $document) {
            $map[$document->getClass()] = $this->getTranslatableFields($document);
        }
        $container->setParameter('graviton.document.type.translatable.fields', $map);

        // write default language to a file so we can statically read it out
        file_put_contents(
            __DIR__.'/../../Entity/Translatable.defaultLanguage',
            $container->getParameter('graviton.translator.default.locale')
        );
    }
public function process(ContainerBuilder $container)
    {
        $this->documentMap = $container->get('graviton.document.map');
        $map = [];
        foreach ($this->documentMap->getDocuments() as $document) {
            $map[$document->getClass()] = $this->getTranslatableFields($document);
        }
        $container->setParameter('graviton.document.type.translatable.fields', $map);

        // write default language to a file so we can statically read it out
        file_put_contents(
            __DIR__.'/../../Entity/Translatable.defaultLanguage',
            $container->getParameter('graviton.translator.default.locale')
        );
    }
public function process ( ContainerBuilder $ container ) { $ this -> documentMap = $ container -> get ( 'graviton.document.map' ) ; $ map = [ ] ; foreach ( $ this -> documentMap -> getDocuments ( ) as $ document ) { $ map [ $ document -> getClass ( ) ] = $ this -> getTranslatableFields ( $ document ) ; } $ container -> setParameter ( 'graviton.document.type.translatable.fields' , $ map ) ; // write default language to a file so we can statically read it out file_put_contents ( __DIR__ . '/../../Entity/Translatable.defaultLanguage' , $ container -> getParameter ( 'graviton.translator.default.locale' ) ) ; }
Make translatable fields map and set it to parameter

@param ContainerBuilder $container container builder
@return void
Make translatable fields map and set it to parameter