src/CoreBundle/Contao/Hooks/AbstractContentElementAndModuleCallback.php
public function getFilterSettings(\DC_Table $objDC)
    {
        $filterSettings = $this->connection->createQueryBuilder()
            ->select('f.id', 'f.name')
            ->from('tl_metamodel_filter', 'f')
            ->where('f.pid=:id')
            ->setParameter('id', $objDC->activeRecord->metamodel)
            ->execute()
            ->fetchAll(\PDO::FETCH_ASSOC);

        $result = [];
        foreach ($filterSettings as $filterSetting) {
            $result[$filterSetting['id']] = $filterSetting['name'];
        }

        // Sort the filter settings.
        asort($result);

        return $result;
    }
public function getFilterSettings(\DC_Table $objDC)
    {
        $filterSettings = $this->connection->createQueryBuilder()
            ->select('f.id', 'f.name')
            ->from('tl_metamodel_filter', 'f')
            ->where('f.pid=:id')
            ->setParameter('id', $objDC->activeRecord->metamodel)
            ->execute()
            ->fetchAll(\PDO::FETCH_ASSOC);

        $result = [];
        foreach ($filterSettings as $filterSetting) {
            $result[$filterSetting['id']] = $filterSetting['name'];
        }

        // Sort the filter settings.
        asort($result);

        return $result;
    }
public function getFilterSettings ( \ DC_Table $ objDC ) { $ filterSettings = $ this -> connection -> createQueryBuilder ( ) -> select ( 'f.id' , 'f.name' ) -> from ( 'tl_metamodel_filter' , 'f' ) -> where ( 'f.pid=:id' ) -> setParameter ( 'id' , $ objDC -> activeRecord -> metamodel ) -> execute ( ) -> fetchAll ( \ PDO :: FETCH_ASSOC ) ; $ result = [ ] ; foreach ( $ filterSettings as $ filterSetting ) { $ result [ $ filterSetting [ 'id' ] ] = $ filterSetting [ 'name' ] ; } // Sort the filter settings. asort ( $ result ) ; return $ result ; }
Fetch all available filter settings for the current meta model.

@param \DC_Table $objDC The data container calling this method.

@return string[] array of all attributes as id => human name
Fetch all available filter settings for the current meta model .