public function getFilterPreselect()
    {
        // get definitions from plugin settings
        // and proceed only when preselectedFilter was not set
        // this reduces the amount of sql queries, too
        if ($this->conf['preselected_filters'] && count($this->preselectedFilter) == 0) {
            $preselectedArray = GeneralUtility::trimExplode(',', $this->conf['preselected_filters'], true);
            foreach ($preselectedArray as $option) {
                $option = intval($option);
                $queryBuilder = Db::getQueryBuilder('tx_kesearch_filters');
                $pageRepository = GeneralUtility::makeInstance(PageRepository::class);
                $filterRows = $queryBuilder
                    ->add(
                        'select',
                        '`tx_kesearch_filters`.`uid` AS filteruid, `tx_kesearch_filteroptions`.`uid` AS optionuid, `tx_kesearch_filteroptions`.`tag`'
                    )
                    ->from('tx_kesearch_filters')
                    ->from('tx_kesearch_filteroptions')
                    ->add(
                        'where',
                        'FIND_IN_SET("' . $option . '",tx_kesearch_filters.options)'
                        . ' AND `tx_kesearch_filteroptions`.`uid` = ' . $option
                        . $pageRepository->enableFields('tx_kesearch_filters')
                        . $pageRepository->enableFields('tx_kesearch_filteroptions')
                    )
                    ->execute()
                    ->fetchAll();

                foreach ($filterRows as $row) {
                    $this->preselectedFilter[$row['filteruid']][$row['optionuid']] = $row['tag'];
                }
            }
        }
    }
public function getFilterPreselect()
    {
        // get definitions from plugin settings
        // and proceed only when preselectedFilter was not set
        // this reduces the amount of sql queries, too
        if ($this->conf['preselected_filters'] && count($this->preselectedFilter) == 0) {
            $preselectedArray = GeneralUtility::trimExplode(',', $this->conf['preselected_filters'], true);
            foreach ($preselectedArray as $option) {
                $option = intval($option);
                $queryBuilder = Db::getQueryBuilder('tx_kesearch_filters');
                $pageRepository = GeneralUtility::makeInstance(PageRepository::class);
                $filterRows = $queryBuilder
                    ->add(
                        'select',
                        '`tx_kesearch_filters`.`uid` AS filteruid, `tx_kesearch_filteroptions`.`uid` AS optionuid, `tx_kesearch_filteroptions`.`tag`'
                    )
                    ->from('tx_kesearch_filters')
                    ->from('tx_kesearch_filteroptions')
                    ->add(
                        'where',
                        'FIND_IN_SET("' . $option . '",tx_kesearch_filters.options)'
                        . ' AND `tx_kesearch_filteroptions`.`uid` = ' . $option
                        . $pageRepository->enableFields('tx_kesearch_filters')
                        . $pageRepository->enableFields('tx_kesearch_filteroptions')
                    )
                    ->execute()
                    ->fetchAll();

                foreach ($filterRows as $row) {
                    $this->preselectedFilter[$row['filteruid']][$row['optionuid']] = $row['tag'];
                }
            }
        }
    }
public function getFilterPreselect ( ) { // get definitions from plugin settings // and proceed only when preselectedFilter was not set // this reduces the amount of sql queries, too if ( $ this -> conf [ 'preselected_filters' ] && count ( $ this -> preselectedFilter ) == 0 ) { $ preselectedArray = GeneralUtility :: trimExplode ( ',' , $ this -> conf [ 'preselected_filters' ] , true ) ; foreach ( $ preselectedArray as $ option ) { $ option = intval ( $ option ) ; $ queryBuilder = Db :: getQueryBuilder ( 'tx_kesearch_filters' ) ; $ pageRepository = GeneralUtility :: makeInstance ( PageRepository :: class ) ; $ filterRows = $ queryBuilder -> add ( 'select' , '`tx_kesearch_filters`.`uid` AS filteruid, `tx_kesearch_filteroptions`.`uid` AS optionuid, `tx_kesearch_filteroptions`.`tag`' ) -> from ( 'tx_kesearch_filters' ) -> from ( 'tx_kesearch_filteroptions' ) -> add ( 'where' , 'FIND_IN_SET("' . $ option . '",tx_kesearch_filters.options)' . ' AND `tx_kesearch_filteroptions`.`uid` = ' . $ option . $ pageRepository -> enableFields ( 'tx_kesearch_filters' ) . $ pageRepository -> enableFields ( 'tx_kesearch_filteroptions' ) ) -> execute ( ) -> fetchAll ( ) ; foreach ( $ filterRows as $ row ) { $ this -> preselectedFilter [ $ row [ 'filteruid' ] ] [ $ row [ 'optionuid' ] ] = $ row [ 'tag' ] ; } } } }
gets all preselected filters from flexform
returns nothing but fills global var with needed data
@return void
gets all preselected filters from flexform returns nothing but fills global var with needed data