fix(criteria): compare backed enums by their scalar value
Using an enum as a criteria value reached PDO as an object and failed with "Object of class X could not be converted to string". Filtering by a state column - the most natural thing to do with an enum-mapped property - was impossible. CriteriaCompiler now unwraps \BackedEnum both for a plain value and inside an an IN list. Covered by CriteriaCompilerEnumTest.
This commit is contained in:
1 parent
316cbdc2cd
commit
318b5b9da2
3 files changed
+74
-1
No files matched your search
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Camelia\Orm\Tests\Fixture;
|
||||
|
||||
enum EstadoPedido: string
|
||||
{
|
||||
case Pendiente = 'pendiente';
|
||||
case Confirmado = 'confirmado';
|
||||
}
|
||||
Reference in new issue
Block a user