-
-
Notifications
You must be signed in to change notification settings - Fork 329
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
Using references in escaped string #1095
Comments
Unfortunately I have to plan to work on the lexer bugs in a near future |
Can you use relationships in your database instead? Or did you try to use an array in the fixtures? Something like that: App\Entity\Preference:
recommendedNews:
value: ["@news1->id"] Then the |
I don't like to design entities around DB fixtures, it shouldn't accept arrays and convert them to JSON just so that test data gets generated correctly. IMHO this is a bad practice. Unless you actually need that behavior in your normal application. Moreover this string field might not be necessary in JSON format for all records. In my case, this is a general configuration table - records will be different according to their name. For now I hardcoded some UUIDs so I don't have to explicitly reference them, but it would be nice if you can use references inside a string. |
I agree that it's bad design, my suggestion was a workaround to avoid being stuck with the error when loading fixtures. |
I have the following case:
Unfortunately once the array is escaped - meaning I want it as string - the contents of the [ ] are not lexed at all. I tried to find some weird way to get into one of the other regexes, but I couldn't.
My idea is to be able to construct JSON array (in this case) containing references to other entities.
Is that possible in some way or planned to be implemented in the future?
The text was updated successfully, but these errors were encountered: