public static function filterEnumByName(
        QueryBuilder $queryBuilder,
        &$criteria,
        $field,
        $enumTypeName,
        $isJoined = false,
        $alias = 'o'
    ) {
        if (isset($criteria[$field])) {
            if (!empty($criteria[$field])) {
                if (!$isJoined) {
                    $queryBuilder->join(sprintf('%s.%s', $alias, $field), 'enum')->join('enum.type', 'enumType');
                }
                $queryBuilder
                    ->andWhere('enumType.name = :enumType')
                    ->andWhere(sprintf('enum.name LIKE :%s', $field))
                    ->setParameter($field, '%'.$criteria[$field].'%')
                    ->setParameter('enumType', $enumTypeName);
            }
            unset($criteria[$field]);
        }

        return $criteria;
    }