I’m a devote Doctrine 1.2 user but times are changing and now I’m faced with the challenge of learning and updating all of my applications to use the brand new Doctrine 2.2 framework.
Doctrine 2.2 has been completely renewed and a lot of cool stuff from Doctrine 1.2 has dissapeared, one that will be missed the most I’m sure is the auto-magic the behaviours provided, this said some new challeneges arise, for example, what type of data to use to store basic data like latitud and longitud since the Geographical behaviour is now gone.
A solution I’ve find is to use decimal type of data with a size of 18,12, so if you are defining your models with YAML like I do you can do the following:
Entities\City: type: entity fields: id: type: integer id: true generator: strategy: AUTO name: type: string(255) latitude: type: decimal(18) scale: 12 precision: 18 nullable: true longitude: type: decimal(18) scale: 12 precision: 18 nullable: true
With this type of data I fixed my need of storing latitude and longitud data.