Skip to content

Commit e511d64

Browse files
author
Matan Yadaev
committed
Spatial functions - pass arguments as bindings
1 parent 369d1a0 commit e511d64

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/SpatialBuilder.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ public function whereDistance(
4949
{
5050
$this->whereRaw(
5151
sprintf(
52-
'ST_DISTANCE(%s, %s) %s %s',
52+
'ST_DISTANCE(%s, %s) %s ?',
5353
$this->getQuery()->getGrammar()->wrap($column),
5454
$this->toExpression($geometryOrColumn),
5555
$operator,
56-
$value,
57-
)
56+
),
57+
[$value],
5858
);
5959

6060
return $this;
@@ -109,12 +109,12 @@ public function whereDistanceSphere(
109109
{
110110
$this->whereRaw(
111111
sprintf(
112-
'ST_DISTANCE_SPHERE(%s, %s) %s %s',
112+
'ST_DISTANCE_SPHERE(%s, %s) %s ?',
113113
$this->getQuery()->getGrammar()->wrap($column),
114114
$this->toExpression($geometryOrColumn),
115115
$operator,
116-
$value
117-
)
116+
),
117+
[$value],
118118
);
119119

120120
return $this;
@@ -276,11 +276,11 @@ public function whereSrid(
276276
{
277277
$this->whereRaw(
278278
sprintf(
279-
'ST_SRID(%s) %s %s',
279+
'ST_SRID(%s) %s ?',
280280
$this->getQuery()->getGrammar()->wrap($column),
281281
$operator,
282-
$value,
283-
)
282+
),
283+
[$value],
284284
);
285285

286286
return $this;

0 commit comments

Comments
 (0)