0

Similar to what you can do in a find call: Calling MySQL functions in Lithium

I would like to be able to do this:

$result = Model::create(array(
   'geoFunctionResult' => "GeometryFromText('POINT({$this->request->data['longitude']} {$this->request->data['latitude']})')",
));

In this case the value needs to be a literal part of the generated SQL so that it executes as a db function, then the result of the function is the actual value inserted.

Community
  • 1
  • 1
Ketema
  • 6,108
  • 3
  • 21
  • 24

1 Answers1

0

Model::create() returns an instance of your Model class which is not yet saved to a database. Calling $instance->save() will do.

Your question doesn't make sense.

Mehdi Lahmam B.
  • 2,240
  • 16
  • 22