prisma-client-php 0.0.28 → 0.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -323,8 +323,35 @@ final class PPHPUtility
|
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
325
|
|
|
326
|
+
private static function isOperatorArray(array $arr)
|
|
327
|
+
{
|
|
328
|
+
$operators = ['contains', 'startsWith', 'endsWith', 'equals', 'not', 'gt', 'gte', 'lt', 'lte', 'in', 'notIn'];
|
|
329
|
+
foreach ($arr as $key => $value) {
|
|
330
|
+
if (!in_array($key, $operators)) {
|
|
331
|
+
return false;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
return true;
|
|
335
|
+
}
|
|
336
|
+
|
|
326
337
|
private static function processSingleCondition($key, $value, &$sqlConditions, &$bindings, $dbType, $tableName, $prefix, $level)
|
|
327
338
|
{
|
|
339
|
+
if (is_array($value) && !self::isOperatorArray($value)) {
|
|
340
|
+
foreach ($value as $nestedKey => $nestedValue) {
|
|
341
|
+
self::processSingleCondition(
|
|
342
|
+
$nestedKey,
|
|
343
|
+
$nestedValue,
|
|
344
|
+
$sqlConditions,
|
|
345
|
+
$bindings,
|
|
346
|
+
$dbType,
|
|
347
|
+
$key,
|
|
348
|
+
$prefix . $key . '_',
|
|
349
|
+
$level + 1
|
|
350
|
+
);
|
|
351
|
+
}
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
|
|
328
355
|
$fieldQuoted = self::quoteColumnName($dbType, $key);
|
|
329
356
|
$qualifiedField = $tableName . '.' . $fieldQuoted;
|
|
330
357
|
|
package/package.json
CHANGED