$parameterType =
class_exists(ArrayParameterType::
class) ? ArrayParameterType::STRING : Connection::PARAM_STR_ARRAY;
// Like above, but we just filter out empty strings.
$values =
array_values(array_filter($values,
fn ($v) => '' !==
(string) $v));
// Convert values into right type
if (Type::
hasType($type)) { $doctrineType = Type::
getType($type);
$platform =
$qb->
getEntityManager()->
getConnection()->
getDatabasePlatform();
foreach ($values as &
$value) { try { $value =
$doctrineType->
convertToDatabaseValue($value,
$platform);
} catch (ConversionException
$e) { throw new TransformationFailedException(sprintf('Failed to transform "%s" into "%s".',
$value,
$type), 0,
$e);
} } unset($value);
} } else { $parameterType =
class_exists(ArrayParameterType::
class) ? ArrayParameterType::STRING : Connection::PARAM_STR_ARRAY;
} if (!
$values) { return [];
}