Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enum Array Support with simple_array Type #6

Open
blueblakk opened this issue Jul 15, 2023 · 0 comments
Open

Enum Array Support with simple_array Type #6

blueblakk opened this issue Jul 15, 2023 · 0 comments

Comments

@blueblakk
Copy link

blueblakk commented Jul 15, 2023

It seems that enum arrays are not supported, or am I doing something wrong?

/**
 * @var FieldType[]
 *
 * @ORM\Column(type="simple_array", enumType="Demo\FieldType")
 */
private array $supportedFields;

I can't use grabFromRepository() or seeInRepository() as it seems like the module doesn't internally handle the conversion to a comma-delimited string properly. I'm not sure if this issue includes haveInRepository() as well since have not tested it.

$result = $this->tester->grabEntityFromRepository(Demo::class, [
    ...
    'supportedFields' => [FieldType.Field1, FieldType.Field2, ...] // <-- problematic
]);

Crashes with a SyntaxErrorException:

Doctrine\DBAL\Exception\SyntaxErrorException : An exception occurred while executing a query: SQLSTATE[42601]: Syntax error: 7 ERROR:  syntax error at or near ","
LINE 1: ...$1 AND d0_.name = $2 AND d0_.supported_fields = $3, $4, $5, ...
                                                             ^
@TavoNiievez TavoNiievez transferred this issue from Codeception/module-doctrine2 Feb 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant