public static function filterToOneField(
        QueryBuilder $queryBuilder,
        &$criteria,
        $field,
        $toOneField,
        $isJoined = false,
        $alias = 'o',
        $aliasField = null
    ) {
        if (isset($criteria[$field])) {
            if (!empty($criteria[$field])) {
                if (!$isJoined) {
                    $queryBuilder
                        ->join(sprintf('%s.%s', $alias, $toOneField), $toOneField);
                }
                $queryBuilder
                    ->andWhere(sprintf('%s.%s LIKE :%s', $toOneField, $aliasField ?: $field, $toOneField.'_'.$field))
                    ->setParameter($toOneField.'_'.$field, '%'.$criteria[$field].'%');
            }
            unset($criteria[$field]);
        }

        return $criteria;
    }