2

I have a problem with the native SQL in Doctrine 2.

The main problem is that the alias does not work. I can only map a SQL-Alias to the entity by adding an annotation. This works fine, if I do it. But it's not really good in production because I have to delete the field in the db first.

I want to build a query with a location based distance in meters but it's not really practical to do it in doctrine so far. I mean it's not something special to get an alias from query.

SELECT *, (RADIANS( ? )) * COS(RADIANS(latitude)) * COS(RADIANS(longitude) - RADIANS( ? )) + SIN(RADIANS( ? )) * SIN(RADIANS(latitude)) AS distance is nothing special in my opinion

Why do I have to handle this alone?

COil
  • 7,201
  • 2
  • 50
  • 98
mariusLAN
  • 1,195
  • 1
  • 12
  • 26

0 Answers0