CakePHP 3 における MySQL のジオメトリ型データ
Takahiro Iwasa
1 min read
CakePHP GIS
It has been more than 3 years since this post was published.
CakePHP 3 は MySQL のジオメトリ型データを処理できます。
$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)')"
);