31
31
use Symfony \Component \PropertyAccess \PropertyAccess ;
32
32
use Symfony \Component \PropertyAccess \PropertyAccessorInterface ;
33
33
use Symfony \Component \Serializer \NameConverter \NameConverterInterface ;
34
+ use Symfony \Component \Uid \Ulid ;
35
+ use Symfony \Component \Uid \Uuid ;
34
36
35
37
/**
36
38
* The search filter allows to filter a collection by given properties.
@@ -196,7 +198,6 @@ protected function filterProperty(string $property, $value, QueryBuilder $queryB
196
198
}
197
199
198
200
$ metadata = $ this ->getNestedMetadata ($ resourceClass , $ associations );
199
-
200
201
if ($ metadata ->hasField ($ field )) {
201
202
if ('id ' === $ field ) {
202
203
$ values = array_map ($ this ->getIdFromValue (...), $ values );
@@ -255,6 +256,7 @@ protected function filterProperty(string $property, $value, QueryBuilder $queryB
255
256
256
257
$ expected = \count ($ values );
257
258
$ values = array_filter ($ values , static fn ($ value ) => null !== $ value );
259
+ $ values = array_map (static fn ($ value ) => $ value instanceof Uuid || $ value instanceof Ulid ? $ value ->toBinary () : $ value , $ values );
258
260
if ($ expected > \count ($ values )) {
259
261
/*
260
262
* Shouldn't this actually fail harder?
@@ -272,7 +274,6 @@ protected function filterProperty(string $property, $value, QueryBuilder $queryB
272
274
$ associationAlias = QueryBuilderHelper::addJoinOnce ($ queryBuilder , $ queryNameGenerator , $ alias , $ associationField );
273
275
$ associationField = $ associationFieldIdentifier ;
274
276
}
275
-
276
277
$ this ->addWhereByStrategy ($ strategy , $ queryBuilder , $ queryNameGenerator , $ associationAlias , $ associationField , $ values , $ caseSensitive );
277
278
}
278
279
0 commit comments