Doctrine/ORM/Provider/PermissionProvider.php
private function addWhereOptionalField(QueryBuilder $qb, $field, $value): void
    {
        if (null === $value) {
            $qb->andWhere('p.'.$field.' IS NULL');
        } else {
            $qb->andWhere('p.'.$field.' = :'.$field)->setParameter($field, $value);
        }
    }
private function addWhereOptionalField(QueryBuilder $qb, $field, $value): void
    {
        if (null === $value) {
            $qb->andWhere('p.'.$field.' IS NULL');
        } else {
            $qb->andWhere('p.'.$field.' = :'.$field)->setParameter($field, $value);
        }
    }
private function addWhereOptionalField ( QueryBuilder $ qb , $ field , $ value ) : void { if ( null === $ value ) { $ qb -> andWhere ( 'p.' . $ field . ' IS NULL' ) ; } else { $ qb -> andWhere ( 'p.' . $ field . ' = :' . $ field ) -> setParameter ( $ field , $ value ) ; } }
Add the optional field condition.

@param QueryBuilder $qb    The query builder
@param string       $field The field name
@param null|mixed   $value The value
Add the optional field condition .