@@ -56,7 +56,7 @@ public function getDevicesFromDB($userId) {
5656 ->where (
5757 $ qb ->expr ()->eq ('user_id ' , $ qb ->createNamedParameter ($ userId , IQueryBuilder::PARAM_STR ))
5858 );
59- $ req = $ qb ->execute ();
59+ $ req = $ qb ->executeQuery ();
6060
6161 while ($ row = $ req ->fetch ()) {
6262 $ devices [intval ($ row ['id ' ])] = [
@@ -88,7 +88,7 @@ public function getDevicesByTokens(array $tokens) {
8888 ->where (
8989 $ qb ->expr ()->in ('s.token ' , $ qb ->createNamedParameter ($ tokens , IQueryBuilder::PARAM_STR_ARRAY ))
9090 );
91- $ req = $ qb ->execute ();
91+ $ req = $ qb ->executeQuery ();
9292
9393 while ($ row = $ req ->fetch ()) {
9494 if (array_key_exists (intval ($ row ['id ' ]), $ devices )) {
@@ -144,7 +144,7 @@ public function getDevicePointsFromDB($userId, $deviceId, ?int $pruneBefore = 0,
144144 $ qb ->setMaxResults ($ limit );
145145 }
146146 $ qb ->orderBy ('timestamp ' , 'DESC ' );
147- $ req = $ qb ->execute ();
147+ $ req = $ qb ->executeQuery ();
148148
149149 $ points = [];
150150 while ($ row = $ req ->fetch ()) {
@@ -199,7 +199,7 @@ public function getDevicePointsByTokens(array $tokens, ?int $pruneBefore = 0, ?i
199199 $ qb ->setMaxResults ($ limit );
200200 }
201201 $ qb ->orderBy ('timestamp ' , 'DESC ' );
202- $ req = $ qb ->execute ();
202+ $ req = $ qb ->executeQuery ();
203203
204204 $ points = [];
205205 while ($ row = $ req ->fetch ()) {
@@ -237,7 +237,7 @@ public function getDeviceTimePointsFromDb($userId, $deviceId) {
237237 $ qb ->expr ()->eq ('d.user_id ' , $ qb ->createNamedParameter ($ userId , IQueryBuilder::PARAM_STR ))
238238 );
239239 $ qb ->orderBy ('timestamp ' , 'ASC ' );
240- $ req = $ qb ->execute ();
240+ $ req = $ qb ->executeQuery ();
241241
242242 $ points = [];
243243 while ($ row = $ req ->fetch ()) {
@@ -258,7 +258,7 @@ public function getOrCreateDeviceFromDB($userId, $userAgent) {
258258 ->andWhere (
259259 $ qb ->expr ()->eq ('user_agent ' , $ qb ->createNamedParameter ($ userAgent , IQueryBuilder::PARAM_STR ))
260260 );
261- $ req = $ qb ->execute ();
261+ $ req = $ qb ->executeQuery ();
262262
263263 while ($ row = $ req ->fetch ()) {
264264 $ deviceId = intval ($ row ['id ' ]);
@@ -272,7 +272,7 @@ public function getOrCreateDeviceFromDB($userId, $userAgent) {
272272 'user_agent ' => $ qb ->createNamedParameter ($ userAgent , IQueryBuilder::PARAM_STR ),
273273 'user_id ' => $ qb ->createNamedParameter ($ userId , IQueryBuilder::PARAM_STR )
274274 ]);
275- $ req = $ qb ->execute ();
275+ $ qb ->executeStatement ();
276276 $ deviceId = $ qb ->getLastInsertId ();
277277 }
278278 return $ deviceId ;
@@ -290,7 +290,7 @@ public function addPointToDB($deviceId, $lat, $lng, $ts, $altitude, $battery, $a
290290 'battery ' => $ qb ->createNamedParameter (is_numeric ($ battery ) ? $ battery : null , IQueryBuilder::PARAM_STR ),
291291 'accuracy ' => $ qb ->createNamedParameter (is_numeric ($ accuracy ) ? $ accuracy : null , IQueryBuilder::PARAM_STR )
292292 ]);
293- $ req = $ qb ->execute ();
293+ $ qb ->executeStatement ();
294294 $ pointId = $ qb ->getLastInsertId ();
295295 return $ pointId ;
296296 }
@@ -332,7 +332,7 @@ public function getDeviceFromDB($id, $userId) {
332332 $ qb ->expr ()->eq ('user_id ' , $ qb ->createNamedParameter ($ userId , IQueryBuilder::PARAM_STR ))
333333 );
334334 }
335- $ req = $ qb ->execute ();
335+ $ req = $ qb ->executeQuery ();
336336
337337 while ($ row = $ req ->fetch ()) {
338338 $ device = [
@@ -358,7 +358,7 @@ public function editDeviceInDB($id, $color, $name) {
358358 $ qb ->where (
359359 $ qb ->expr ()->eq ('id ' , $ qb ->createNamedParameter ($ id , IQueryBuilder::PARAM_INT ))
360360 );
361- $ req = $ qb ->execute ();
361+ $ qb ->executeStatement ();
362362 }
363363
364364 public function deleteDeviceFromDB ($ id ) {
@@ -367,13 +367,13 @@ public function deleteDeviceFromDB($id) {
367367 ->where (
368368 $ qb ->expr ()->eq ('id ' , $ qb ->createNamedParameter ($ id , IQueryBuilder::PARAM_INT ))
369369 );
370- $ req = $ qb ->execute ();
370+ $ qb ->executeStatement ();
371371
372372 $ qb ->delete ('maps_device_points ' )
373373 ->where (
374374 $ qb ->expr ()->eq ('device_id ' , $ qb ->createNamedParameter ($ id , IQueryBuilder::PARAM_INT ))
375375 );
376- $ req = $ qb ->execute ();
376+ $ qb ->executeStatement ();
377377 }
378378
379379 public function countPoints ($ userId , $ deviceIdList , $ begin , $ end ) {
@@ -403,7 +403,7 @@ public function countPoints($userId, $deviceIdList, $begin, $end) {
403403 $ qb ->expr ()->lt ('p.timestamp ' , $ qb ->createNamedParameter (intval ($ end ), IQueryBuilder::PARAM_INT ))
404404 );
405405 }
406- $ req = $ qb ->execute ();
406+ $ req = $ qb ->executeQuery ();
407407 $ count = 0 ;
408408 while ($ row = $ req ->fetch ()) {
409409 $ count = intval ($ row ['co ' ]);
@@ -487,7 +487,7 @@ private function getAndWriteDevicePoints($devid, $begin, $end, $fd, $nbPoints, $
487487 $ qb ->setFirstResult ($ pointIndex );
488488 $ qb ->setMaxResults ($ chunkSize );
489489 $ qb ->orderBy ('timestamp ' , 'ASC ' );
490- $ req = $ qb ->execute ();
490+ $ req = $ qb ->executeQuery ();
491491
492492 while ($ row = $ req ->fetch ()) {
493493 $ id = intval ($ row ['id ' ]);
0 commit comments