src/Graviton/DocumentBundle/DependencyInjection/Compiler/SolrDefinitionCompilerPass.php
public function process(ContainerBuilder $container)
    {
        $this->documentMap = $container->get('graviton.document.map');

        $map = [];
        foreach ($this->documentMap->getDocuments() as $document) {
            $solrFields = $document->getSolrFields();
            if (is_array($solrFields) && !empty($solrFields)) {
                $map[$document->getClass()] = $this->getSolrWeightString($solrFields);
            }
        }

        $container->setParameter('graviton.document.solr.map', $map);
    }
public function process(ContainerBuilder $container)
    {
        $this->documentMap = $container->get('graviton.document.map');

        $map = [];
        foreach ($this->documentMap->getDocuments() as $document) {
            $solrFields = $document->getSolrFields();
            if (is_array($solrFields) && !empty($solrFields)) {
                $map[$document->getClass()] = $this->getSolrWeightString($solrFields);
            }
        }

        $container->setParameter('graviton.document.solr.map', $map);
    }
public function process ( ContainerBuilder $ container ) { $ this -> documentMap = $ container -> get ( 'graviton.document.map' ) ; $ map = [ ] ; foreach ( $ this -> documentMap -> getDocuments ( ) as $ document ) { $ solrFields = $ document -> getSolrFields ( ) ; if ( is_array ( $ solrFields ) && ! empty ( $ solrFields ) ) { $ map [ $ document -> getClass ( ) ] = $ this -> getSolrWeightString ( $ solrFields ) ; } } $ container -> setParameter ( 'graviton.document.solr.map' , $ map ) ; }
map with the weight string incorporated

@param ContainerBuilder $container container builder
@return void
map with the weight string incorporated