I'm developing an application using Google Maps for geolocation. In
order to use DB geometry functions, I'm using a field of type
GEOMETRY, and some MySQL functions to manipulate it. The GoogleMaps
helper I'm using sets two hidden fields, 'latitude' and 'longitude',
that are needed to form a WKT string like "POINT(0 0)" that will be
later passed to the geolocation field in the DB table.
For this to work, SQL queries must use Geometry functions to translate
(latitude, longitude) into geometry values.
The question is: is there a way to tell Cake that a field value is a
SQL expression and not a value itself?
function beforeSave() {
$this->data['Model']['field'] = array('sql' =>
"GeometryFromText(POINT({$this->data['Model']['latitude']} {$this-
>data['Model']['longitude']}");
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---