E
E
Eugene Wolf2016-11-15 15:12:56
symfony
Eugene Wolf, 2016-11-15 15:12:56

How does Doctrine2 support PostgreSQL arrays?

Good day dear!
Can you please tell me how the latest versions of Symfony3/Doctrine2 support the PostgreSQL data type "array"?
Here on this page it is described in great detail about various connections, incl. "many-to-many" and relationships "through the table", but not a word is said how to organize a relationship of the form

... JOIN table_b ON table_b.id IN table_a.array_field_values WHERE table_a.id = 10;
or
... JOIN table_b ON table_b.id = ANY(table_a.array_field_values) WHERE table_a.id = 10;
(I described the request example very conditionally, but I think you will understand what I mean).
Maybe there is some way to describe such a relationship in the repository (DQL), bind it to an Entity property and specify automatic loading ( fetch="EAGER") in the annotations, just like it can be done with "standard" relationships?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question