@@ -1396,9 +1396,9 @@ protected function handleDistanceSpatialQueries(Query $query, array &$binds, str
13961396 if ($ wktType != Database::VAR_POINT || $ attrType != Database::VAR_POINT ) {
13971397 throw new QueryException ('Distance in meters is not supported between ' .$ attrType . ' and ' . $ wktType );
13981398 }
1399- return "ST_DISTANCE_SPHERE( {$ alias }. {$ attribute }, " . $ this ->getSpatialGeomFromText (": {$ placeholder }_0 " ) . ", " . Database::EARTH_RADIUS . ") {$ operator } : {$ placeholder }_1 " ;
1399+ return "ST_DISTANCE_SPHERE( {$ alias }. {$ attribute }, " . $ this ->getSpatialGeomFromText (": {$ placeholder }_0 " , null ) . ", " . Database::EARTH_RADIUS . ") {$ operator } : {$ placeholder }_1 " ;
14001400 }
1401- return "ST_Distance( {$ alias }. {$ attribute }, " . $ this ->getSpatialGeomFromText (": {$ placeholder }_0 " ) . ") {$ operator } : {$ placeholder }_1 " ;
1401+ return "ST_Distance( {$ alias }. {$ attribute }, " . $ this ->getSpatialGeomFromText (": {$ placeholder }_0 " , null ) . ") {$ operator } : {$ placeholder }_1 " ;
14021402 }
14031403
14041404 /**
@@ -1417,11 +1417,11 @@ protected function handleSpatialQueries(Query $query, array &$binds, string $att
14171417 switch ($ query ->getMethod ()) {
14181418 case Query::TYPE_CROSSES :
14191419 $ binds [": {$ placeholder }_0 " ] = $ this ->convertArrayToWKT ($ query ->getValues ()[0 ]);
1420- return "ST_Crosses( {$ alias }. {$ attribute }, " . $ this ->getSpatialGeomFromText (": {$ placeholder }_0 " ) . ") " ;
1420+ return "ST_Crosses( {$ alias }. {$ attribute }, " . $ this ->getSpatialGeomFromText (": {$ placeholder }_0 " , null ) . ") " ;
14211421
14221422 case Query::TYPE_NOT_CROSSES :
14231423 $ binds [": {$ placeholder }_0 " ] = $ this ->convertArrayToWKT ($ query ->getValues ()[0 ]);
1424- return "NOT ST_Crosses( {$ alias }. {$ attribute }, " . $ this ->getSpatialGeomFromText (": {$ placeholder }_0 " ) . ") " ;
1424+ return "NOT ST_Crosses( {$ alias }. {$ attribute }, " . $ this ->getSpatialGeomFromText (": {$ placeholder }_0 " , null ) . ") " ;
14251425
14261426 case Query::TYPE_DISTANCE_EQUAL :
14271427 case Query::TYPE_DISTANCE_NOT_EQUAL :
@@ -1431,43 +1431,43 @@ protected function handleSpatialQueries(Query $query, array &$binds, string $att
14311431
14321432 case Query::TYPE_INTERSECTS :
14331433 $ binds [": {$ placeholder }_0 " ] = $ this ->convertArrayToWKT ($ query ->getValues ()[0 ]);
1434- return "ST_Intersects( {$ alias }. {$ attribute }, " . $ this ->getSpatialGeomFromText (": {$ placeholder }_0 " ) . ") " ;
1434+ return "ST_Intersects( {$ alias }. {$ attribute }, " . $ this ->getSpatialGeomFromText (": {$ placeholder }_0 " , null ) . ") " ;
14351435
14361436 case Query::TYPE_NOT_INTERSECTS :
14371437 $ binds [": {$ placeholder }_0 " ] = $ this ->convertArrayToWKT ($ query ->getValues ()[0 ]);
1438- return "NOT ST_Intersects( {$ alias }. {$ attribute }, " . $ this ->getSpatialGeomFromText (": {$ placeholder }_0 " ) . ") " ;
1438+ return "NOT ST_Intersects( {$ alias }. {$ attribute }, " . $ this ->getSpatialGeomFromText (": {$ placeholder }_0 " , null ) . ") " ;
14391439
14401440 case Query::TYPE_OVERLAPS :
14411441 $ binds [": {$ placeholder }_0 " ] = $ this ->convertArrayToWKT ($ query ->getValues ()[0 ]);
1442- return "ST_Overlaps( {$ alias }. {$ attribute }, " . $ this ->getSpatialGeomFromText (": {$ placeholder }_0 " ) . ") " ;
1442+ return "ST_Overlaps( {$ alias }. {$ attribute }, " . $ this ->getSpatialGeomFromText (": {$ placeholder }_0 " , null ) . ") " ;
14431443
14441444 case Query::TYPE_NOT_OVERLAPS :
14451445 $ binds [": {$ placeholder }_0 " ] = $ this ->convertArrayToWKT ($ query ->getValues ()[0 ]);
1446- return "NOT ST_Overlaps( {$ alias }. {$ attribute }, " . $ this ->getSpatialGeomFromText (": {$ placeholder }_0 " ) . ") " ;
1446+ return "NOT ST_Overlaps( {$ alias }. {$ attribute }, " . $ this ->getSpatialGeomFromText (": {$ placeholder }_0 " , null ) . ") " ;
14471447
14481448 case Query::TYPE_TOUCHES :
14491449 $ binds [": {$ placeholder }_0 " ] = $ this ->convertArrayToWKT ($ query ->getValues ()[0 ]);
1450- return "ST_Touches( {$ alias }. {$ attribute }, " . $ this ->getSpatialGeomFromText (": {$ placeholder }_0 " ) . ") " ;
1450+ return "ST_Touches( {$ alias }. {$ attribute }, " . $ this ->getSpatialGeomFromText (": {$ placeholder }_0 " , null ) . ") " ;
14511451
14521452 case Query::TYPE_NOT_TOUCHES :
14531453 $ binds [": {$ placeholder }_0 " ] = $ this ->convertArrayToWKT ($ query ->getValues ()[0 ]);
1454- return "NOT ST_Touches( {$ alias }. {$ attribute }, " . $ this ->getSpatialGeomFromText (": {$ placeholder }_0 " ) . ") " ;
1454+ return "NOT ST_Touches( {$ alias }. {$ attribute }, " . $ this ->getSpatialGeomFromText (": {$ placeholder }_0 " , null ) . ") " ;
14551455
14561456 case Query::TYPE_EQUAL :
14571457 $ binds [": {$ placeholder }_0 " ] = $ this ->convertArrayToWKT ($ query ->getValues ()[0 ]);
1458- return "ST_Equals( {$ alias }. {$ attribute }, " . $ this ->getSpatialGeomFromText (": {$ placeholder }_0 " ) . ") " ;
1458+ return "ST_Equals( {$ alias }. {$ attribute }, " . $ this ->getSpatialGeomFromText (": {$ placeholder }_0 " , null ) . ") " ;
14591459
14601460 case Query::TYPE_NOT_EQUAL :
14611461 $ binds [": {$ placeholder }_0 " ] = $ this ->convertArrayToWKT ($ query ->getValues ()[0 ]);
1462- return "NOT ST_Equals( {$ alias }. {$ attribute }, " . $ this ->getSpatialGeomFromText (": {$ placeholder }_0 " ) . ") " ;
1462+ return "NOT ST_Equals( {$ alias }. {$ attribute }, " . $ this ->getSpatialGeomFromText (": {$ placeholder }_0 " , null ) . ") " ;
14631463
14641464 case Query::TYPE_CONTAINS :
14651465 $ binds [": {$ placeholder }_0 " ] = $ this ->convertArrayToWKT ($ query ->getValues ()[0 ]);
1466- return "ST_Contains( {$ alias }. {$ attribute }, " . $ this ->getSpatialGeomFromText (": {$ placeholder }_0 " ) . ") " ;
1466+ return "ST_Contains( {$ alias }. {$ attribute }, " . $ this ->getSpatialGeomFromText (": {$ placeholder }_0 " , null ) . ") " ;
14671467
14681468 case Query::TYPE_NOT_CONTAINS :
14691469 $ binds [": {$ placeholder }_0 " ] = $ this ->convertArrayToWKT ($ query ->getValues ()[0 ]);
1470- return "NOT ST_Contains( {$ alias }. {$ attribute }, " . $ this ->getSpatialGeomFromText (": {$ placeholder }_0 " ) . ") " ;
1470+ return "NOT ST_Contains( {$ alias }. {$ attribute }, " . $ this ->getSpatialGeomFromText (": {$ placeholder }_0 " , null ) . ") " ;
14711471
14721472 default :
14731473 throw new DatabaseException ('Unknown spatial query method: ' . $ query ->getMethod ());
0 commit comments