I am trying to use PostGIS functions in my queries. I am using jsor/doctrine-postgis package to add relevant functionality to Doctrine. I am not exactly sure if I have configured it incorrectly or if I am doing something wrong.
For example:
->where('ST_Intersects(st.coords,ST_MakeEnvelope(-1,-1,1,1,4326))')
However this does not work because syntax checker wants a comparison operator. I get the following error:
Error: Expected =, <, <=, <>, >, >=, !=, got end of string
I managed to avoid this error by checking true/false. While this is undesirable, it works.
->where('ST_Intersects(st.coords,ST_MakeEnvelope(-1,-1,1,1,4326))=true')
But I want to use the && operator. I am not sure exactly how can I manage that? What I mean is something like this:
->where('st.coords && ST_MakeEnvelope(-1,-1,1,1,4326))')
But this returns an error:
Error: Expected =, <, <=, <>, >, >=, !=, got '&'
Am I doing something wrong? This feels over-complicated for some reason?