protected function prefetchModules($config)
    {
        $ids    = $this->extractModuleIds($config);
        $models = [];

        if ($ids) {
            // prefetch modules, so only 1 query is required
            $ids        = implode(',', $ids);
            $collection = ModuleModel::findBy(['tl_module.id IN(' . $ids . ')'], []);

            if ($collection) {
                while ($collection->next()) {
                    $model              = $collection->current();
                    $model->bs_inNavbar = true;
                    $models[$model->id] = $model;
                }
            }
        }

        return $models;
    }
protected function prefetchModules($config)
    {
        $ids    = $this->extractModuleIds($config);
        $models = [];

        if ($ids) {
            // prefetch modules, so only 1 query is required
            $ids        = implode(',', $ids);
            $collection = ModuleModel::findBy(['tl_module.id IN(' . $ids . ')'], []);

            if ($collection) {
                while ($collection->next()) {
                    $model              = $collection->current();
                    $model->bs_inNavbar = true;
                    $models[$model->id] = $model;
                }
            }
        }

        return $models;
    }
protected function prefetchModules ( $ config ) { $ ids = $ this -> extractModuleIds ( $ config ) ; $ models = [ ] ; if ( $ ids ) { // prefetch modules, so only 1 query is required $ ids = implode ( ',' , $ ids ) ; $ collection = ModuleModel :: findBy ( [ 'tl_module.id IN(' . $ ids . ')' ] , [ ] ) ; if ( $ collection ) { while ( $ collection -> next ( ) ) { $ model = $ collection -> current ( ) ; $ model -> bs_inNavbar = true ; $ models [ $ model -> id ] = $ model ; } } } return $ models ; }
Prefetch modules.

@param array $config Navbar config.

@return array
Prefetch modules .