Bundle/WidgetMapBundle/Warmer/WidgetDataWarmer.php
private function injectWidgets(View $view, $viewWidgets)
    {
        $builtWidgetMap = $view->getBuiltWidgetMap();

        foreach ($builtWidgetMap as $slot => $widgetMaps) {
            foreach ($widgetMaps as $i => $widgetMap) {
                foreach ($viewWidgets as $widget) {
                    if ($widget->getWidgetMap() == $widgetMap) {
                        $builtWidgetMap[$slot][$i]->addWidget($widget);

                        //Override Collection default behaviour to avoid useless query
                        $builtWidgetMap[$slot][$i]->getWidgets()->setDirty(false);
                        $builtWidgetMap[$slot][$i]->getWidgets()->setInitialized(true);
                        continue;
                    }
                }
            }
        }

        $view->setBuiltWidgetMap($builtWidgetMap);
    }
private function injectWidgets(View $view, $viewWidgets)
    {
        $builtWidgetMap = $view->getBuiltWidgetMap();

        foreach ($builtWidgetMap as $slot => $widgetMaps) {
            foreach ($widgetMaps as $i => $widgetMap) {
                foreach ($viewWidgets as $widget) {
                    if ($widget->getWidgetMap() == $widgetMap) {
                        $builtWidgetMap[$slot][$i]->addWidget($widget);

                        //Override Collection default behaviour to avoid useless query
                        $builtWidgetMap[$slot][$i]->getWidgets()->setDirty(false);
                        $builtWidgetMap[$slot][$i]->getWidgets()->setInitialized(true);
                        continue;
                    }
                }
            }
        }

        $view->setBuiltWidgetMap($builtWidgetMap);
    }
private function injectWidgets ( View $ view , $ viewWidgets ) { $ builtWidgetMap = $ view -> getBuiltWidgetMap ( ) ; foreach ( $ builtWidgetMap as $ slot => $ widgetMaps ) { foreach ( $ widgetMaps as $ i => $ widgetMap ) { foreach ( $ viewWidgets as $ widget ) { if ( $ widget -> getWidgetMap ( ) == $ widgetMap ) { $ builtWidgetMap [ $ slot ] [ $ i ] -> addWidget ( $ widget ) ; //Override Collection default behaviour to avoid useless query $ builtWidgetMap [ $ slot ] [ $ i ] -> getWidgets ( ) -> setDirty ( false ) ; $ builtWidgetMap [ $ slot ] [ $ i ] -> getWidgets ( ) -> setInitialized ( true ) ; continue ; } } } } $ view -> setBuiltWidgetMap ( $ builtWidgetMap ) ; }
Inject Widgets in View's builtWidgetMap.

@param View $view
@param $viewWidgets
Inject Widgets in View s builtWidgetMap .