Zend Framework 2 - Doctrine 2 - How to use GeoPointFields

瘦欲@ 提交于 2019-12-13 06:02:58

问题


I need to implement a GeoPointField with Doctrine2.

It seems that Zend and Doctrine don't support it natively...

Is there a best practice for validating such an input? In the database I'd use a simple string field, right?


回答1:


/^(\-?\d+(?:\.\d+)?),?\s*(\-?\d+(?:\.\d+)?)$/

This regexp validates and captures GEO input:

  • Latitude, Longitude
  • Latitude Longitude
  • Coords copied directly from GoogleMaps


来源:https://stackoverflow.com/questions/14067212/zend-framework-2-doctrine-2-how-to-use-geopointfields

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!