MySQL geometry Type Data in CakePHP 3
Takahiro Iwasa
1 min read
CakePHP GIS
It has been more than 3 years since this post was published.
CakePHP 3 can handle MySQL geometry type data. Happy Coding!
$myHousesTable = TableRegistry::get('MyHouses');
$myHouse = $myHousesTable->newEntity();
$myHouse->latlng = $myHousesTable->query()->newExpr()->add(
// Note that Point argument order is longitude followed by latitude.
"ST_GeomFromText('Point(138.727777 35.360556)')"
);