protected function getUidListFromRecords(string $idList): string
    {
        $list = [];
        $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
            ->getQueryBuilderForTable('sys_category');
        $rows = $queryBuilder
            ->select('uid')
            ->from('sys_category')
            ->where(
                $queryBuilder->expr()->in('uid', $queryBuilder->createNamedParameter(explode(',', $idList), Connection::PARAM_INT_ARRAY))
            )
            ->execute()
            ->fetchAll();
        foreach ($rows as $row) {
            $list[] = $row['uid'];
        }

        return implode(',', $list);
    }
protected function getUidListFromRecords(string $idList): string
    {
        $list = [];
        $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
            ->getQueryBuilderForTable('sys_category');
        $rows = $queryBuilder
            ->select('uid')
            ->from('sys_category')
            ->where(
                $queryBuilder->expr()->in('uid', $queryBuilder->createNamedParameter(explode(',', $idList), Connection::PARAM_INT_ARRAY))
            )
            ->execute()
            ->fetchAll();
        foreach ($rows as $row) {
            $list[] = $row['uid'];
        }

        return implode(',', $list);
    }
protected function getUidListFromRecords ( string $ idList ) : string { $ list = [ ] ; $ queryBuilder = GeneralUtility :: makeInstance ( ConnectionPool :: class ) -> getQueryBuilderForTable ( 'sys_category' ) ; $ rows = $ queryBuilder -> select ( 'uid' ) -> from ( 'sys_category' ) -> where ( $ queryBuilder -> expr ( ) -> in ( 'uid' , $ queryBuilder -> createNamedParameter ( explode ( ',' , $ idList ) , Connection :: PARAM_INT_ARRAY ) ) ) -> execute ( ) -> fetchAll ( ) ; foreach ( $ rows as $ row ) { $ list [ ] = $ row [ 'uid' ] ; } return implode ( ',' , $ list ) ; }
Fetch ids again from DB to avoid false positives

@param string $idList
@return string
Fetch ids again from DB to avoid false positives