You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Move logic to makes queries without limits to the relevant adapters (#257)
* Update documentation to include info on the Exporter
* Refactor exporter and adapters to support unlimited results
* Make setStart sanitation more intuitive
* Update MongoDBAdapter.php
Make MongoAdapter behavior for length NULL consistent with other adapters
Co-authored-by: Niels Keurentjes <[email protected]>
@@ -146,11 +144,13 @@ public function getStart(): int
146
144
return$this->start;
147
145
}
148
146
149
-
/**
150
-
* @return $this
151
-
*/
152
-
publicfunctionsetStart(int$start)
147
+
publicfunctionsetStart(int$start): self
153
148
{
149
+
if ($start < 0) {
150
+
@trigger_error(sprintf('Passing a negative value to the "%s::setStart()" method makes no logical sense, defaulting to 0 as the most sane default.', self::class), \E_USER_DEPRECATED);
151
+
$start = 0;
152
+
}
153
+
154
154
$this->start = $start;
155
155
156
156
return$this;
@@ -161,11 +161,13 @@ public function getLength(): int
161
161
return$this->length;
162
162
}
163
163
164
-
/**
165
-
* @return $this
166
-
*/
167
-
publicfunctionsetLength(int$length)
164
+
publicfunctionsetLength(?int$length): self
168
165
{
166
+
if ($length < 1) {
167
+
@trigger_error(sprintf('Calling the "%s::setLength()" method with a length less than 1 is deprecated since version 0.7 of this bundle. If you need to unrestrict the amount of records returned, pass null instead.', self::class), \E_USER_DEPRECATED);
168
+
$length = null;
169
+
}
170
+
169
171
$this->length = $length;
170
172
171
173
return$this;
@@ -176,20 +178,14 @@ public function getGlobalSearch(): string
0 commit comments