Doctrine/ORM/Provider/PermissionProvider.php
private function addWhereContexts(QueryBuilder $qb, $contexts = null): void
    {
        if (null !== $contexts) {
            $contexts = (array) $contexts;
            $where = 'p.contexts IS NULL';

            foreach ($contexts as $context) {
                $key = 'context_'.$context;
                $where .= sprintf(' OR p.contexts LIKE :%s', $key);
                $qb->setParameter($key, '%"'.$context.'"%');
            }

            $qb->andWhere($where);
        }
    }
private function addWhereContexts(QueryBuilder $qb, $contexts = null): void
    {
        if (null !== $contexts) {
            $contexts = (array) $contexts;
            $where = 'p.contexts IS NULL';

            foreach ($contexts as $context) {
                $key = 'context_'.$context;
                $where .= sprintf(' OR p.contexts LIKE :%s', $key);
                $qb->setParameter($key, '%"'.$context.'"%');
            }

            $qb->andWhere($where);
        }
    }
private function addWhereContexts ( QueryBuilder $ qb , $ contexts = null ) : void { if ( null !== $ contexts ) { $ contexts = ( array ) $ contexts ; $ where = 'p.contexts IS NULL' ; foreach ( $ contexts as $ context ) { $ key = 'context_' . $ context ; $ where .= sprintf ( ' OR p.contexts LIKE :%s' , $ key ) ; $ qb -> setParameter ( $ key , '%"' . $ context . '"%' ) ; } $ qb -> andWhere ( $ where ) ; } }
Add the permission contexts condition.

@param QueryBuilder         $qb       The query builder
@param null|string|string[] $contexts The contexts
Add the permission contexts condition .