I'm developing an application using geolocation data. The GoogleMaps
helper I'm using sets 'latitude' and 'longitude' fields according to
user selection on the map. In order to use geometry functions of
MySQL, I need to use a DB field of type GEOMETRY, which requires some
SQL manipulation on the given data.

In short: Is there a way to tell Cake that a field value is not a
string but a SQL expression? Something like:

function beforeSave() {
    /* ... */
    $this->data['Model']['geolocation'] = array('sql' =>
"GeometryFromText(POINT({$this->data['Model']['lat']} {$this-
>data['Model']['lng']}))");
    /* ... */
}

Or is using a complete SQL insert/update sentence the only way around
this?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to