Parcourir la source

Se quita el límite de resultados si se filtra por ids.

Maxi Schvindt il y a 7 ans
Parent
commit
f4c224b26d
1 fichiers modifiés avec 4 ajouts et 3 suppressions
  1. 4 3
      Controller/RESTController.php

+ 4 - 3
Controller/RESTController.php

@@ -86,15 +86,16 @@ abstract class RESTController extends VoryxController
                             $criteria->andWhere($criteria->expr()->contains("$field", "$value"));
                         }
                     }
+                    
+                    if (!is_null($paramFetcher->get('limit'))) {
+                        $criteria->setMaxResults($paramFetcher->get('limit'));
+                    }
                 }
 
                 if (!is_null($paramFetcher->get('offset'))) {
                     $criteria->setFirstResult($paramFetcher->get('offset'));
                 }
 
-                if (!is_null($paramFetcher->get('limit'))) {
-                    $criteria->setMaxResults($paramFetcher->get('limit'));
-                }
 
                 if ($paramFetcher->get('order_by')) {
                     $order_by = $paramFetcher->get('order_by');