Bundle/WidgetBundle/Repository/WidgetRepository.php
public function getAllForView(View $view)
    {
        //Get all WidgetMaps ids for this View
        $widgetMapsIdsToSearch = [];
        foreach ($view->getBuiltWidgetMap() as $widgetMaps) {
            foreach ($widgetMaps as $widgetMap) {
                $widgetMapsIdsToSearch[] = $widgetMap->getId();
            }
        }

        return $this->createQueryBuilder('widget')
            ->join('widget.widgetMap', 'widgetMap')
            ->andWhere('widgetMap.id IN (:widgetMapsIds)')
            ->setParameter('widgetMapsIds', $widgetMapsIdsToSearch);
    }
public function getAllForView(View $view)
    {
        //Get all WidgetMaps ids for this View
        $widgetMapsIdsToSearch = [];
        foreach ($view->getBuiltWidgetMap() as $widgetMaps) {
            foreach ($widgetMaps as $widgetMap) {
                $widgetMapsIdsToSearch[] = $widgetMap->getId();
            }
        }

        return $this->createQueryBuilder('widget')
            ->join('widget.widgetMap', 'widgetMap')
            ->andWhere('widgetMap.id IN (:widgetMapsIds)')
            ->setParameter('widgetMapsIds', $widgetMapsIdsToSearch);
    }
public function getAllForView ( View $ view ) { //Get all WidgetMaps ids for this View $ widgetMapsIdsToSearch = [ ] ; foreach ( $ view -> getBuiltWidgetMap ( ) as $ widgetMaps ) { foreach ( $ widgetMaps as $ widgetMap ) { $ widgetMapsIdsToSearch [ ] = $ widgetMap -> getId ( ) ; } } return $ this -> createQueryBuilder ( 'widget' ) -> join ( 'widget.widgetMap' , 'widgetMap' ) -> andWhere ( 'widgetMap.id IN (:widgetMapsIds)' ) -> setParameter ( 'widgetMapsIds' , $ widgetMapsIdsToSearch ) ; }
Get all Widgets for a given View.

@param View $view

@return QueryBuilder
Get all Widgets for a given View .