public function getGroupsForAddress($address)
    {
        $groupTitles = [];

        $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_category');
        $queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class));
        $result = $queryBuilder
            ->select('c.*')
            ->from('sys_category', 'c')
            ->join(
                'c',
                'sys_category_record_mm',
                'mm',
                $queryBuilder->expr()->eq(
                    'c.uid',
                    $queryBuilder->quoteIdentifier('mm.uid_local')
                )
            )
            ->where(
                $queryBuilder->expr()->eq('mm.uid_foreign', $queryBuilder->createNamedParameter((int)$address['uid'], \PDO::PARAM_INT)),
                $queryBuilder->expr()->eq('mm.tablenames', $queryBuilder->createNamedParameter('tt_address', \PDO::PARAM_STR)),
                $queryBuilder->expr()->eq('mm.fieldname', $queryBuilder->createNamedParameter('categories', \PDO::PARAM_STR))
            )
            ->orderBy('mm.sorting_foreign')
            ->execute();
        while ($groupRecord = $result->fetch()) {
            if ($this->getTypoScriptFrontendController()->sys_language_content) {
                $groupRecord = $this->getTypoScriptFrontendController()->sys_page->getRecordOverlay('sys_category',
                    $groupRecord, $this->getTypoScriptFrontendController()->sys_language_content);
            }
            if ($groupRecord) {
                $address['groups'][] = $groupRecord;
                $groupTitles[] = $groupRecord['title'];
            }
        }

        $groupList = implode(', ', $groupTitles);
        $address['groupList'] = $groupList;
        return $address;
    }
public function getGroupsForAddress($address)
    {
        $groupTitles = [];

        $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_category');
        $queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class));
        $result = $queryBuilder
            ->select('c.*')
            ->from('sys_category', 'c')
            ->join(
                'c',
                'sys_category_record_mm',
                'mm',
                $queryBuilder->expr()->eq(
                    'c.uid',
                    $queryBuilder->quoteIdentifier('mm.uid_local')
                )
            )
            ->where(
                $queryBuilder->expr()->eq('mm.uid_foreign', $queryBuilder->createNamedParameter((int)$address['uid'], \PDO::PARAM_INT)),
                $queryBuilder->expr()->eq('mm.tablenames', $queryBuilder->createNamedParameter('tt_address', \PDO::PARAM_STR)),
                $queryBuilder->expr()->eq('mm.fieldname', $queryBuilder->createNamedParameter('categories', \PDO::PARAM_STR))
            )
            ->orderBy('mm.sorting_foreign')
            ->execute();
        while ($groupRecord = $result->fetch()) {
            if ($this->getTypoScriptFrontendController()->sys_language_content) {
                $groupRecord = $this->getTypoScriptFrontendController()->sys_page->getRecordOverlay('sys_category',
                    $groupRecord, $this->getTypoScriptFrontendController()->sys_language_content);
            }
            if ($groupRecord) {
                $address['groups'][] = $groupRecord;
                $groupTitles[] = $groupRecord['title'];
            }
        }

        $groupList = implode(', ', $groupTitles);
        $address['groupList'] = $groupList;
        return $address;
    }
public function getGroupsForAddress ( $ address ) { $ groupTitles = [ ] ; $ queryBuilder = GeneralUtility :: makeInstance ( ConnectionPool :: class ) -> getQueryBuilderForTable ( 'sys_category' ) ; $ queryBuilder -> setRestrictions ( GeneralUtility :: makeInstance ( FrontendRestrictionContainer :: class ) ) ; $ result = $ queryBuilder -> select ( 'c.*' ) -> from ( 'sys_category' , 'c' ) -> join ( 'c' , 'sys_category_record_mm' , 'mm' , $ queryBuilder -> expr ( ) -> eq ( 'c.uid' , $ queryBuilder -> quoteIdentifier ( 'mm.uid_local' ) ) ) -> where ( $ queryBuilder -> expr ( ) -> eq ( 'mm.uid_foreign' , $ queryBuilder -> createNamedParameter ( ( int ) $ address [ 'uid' ] , \ PDO :: PARAM_INT ) ) , $ queryBuilder -> expr ( ) -> eq ( 'mm.tablenames' , $ queryBuilder -> createNamedParameter ( 'tt_address' , \ PDO :: PARAM_STR ) ) , $ queryBuilder -> expr ( ) -> eq ( 'mm.fieldname' , $ queryBuilder -> createNamedParameter ( 'categories' , \ PDO :: PARAM_STR ) ) ) -> orderBy ( 'mm.sorting_foreign' ) -> execute ( ) ; while ( $ groupRecord = $ result -> fetch ( ) ) { if ( $ this -> getTypoScriptFrontendController ( ) -> sys_language_content ) { $ groupRecord = $ this -> getTypoScriptFrontendController ( ) -> sys_page -> getRecordOverlay ( 'sys_category' , $ groupRecord , $ this -> getTypoScriptFrontendController ( ) -> sys_language_content ) ; } if ( $ groupRecord ) { $ address [ 'groups' ] [ ] = $ groupRecord ; $ groupTitles [ ] = $ groupRecord [ 'title' ] ; } } $ groupList = implode ( ', ' , $ groupTitles ) ; $ address [ 'groupList' ] = $ groupList ; return $ address ; }
gets the groups an address record is in

@param array $address An address record
@return array The address plus its groups
gets the groups an address record is in