prisma-client-php 3.0.2 → 3.0.3

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.
@@ -64,6 +64,10 @@ final class PPHPUtility
64
64
  }
65
65
 
66
66
  if (is_string($key) && is_array($value)) {
67
+ if (self::isAtomicOperationArray($value)) {
68
+ continue;
69
+ }
70
+
67
71
  if (isset($value['select'])) {
68
72
  $relatedEntityFields[$key] = $value['select'];
69
73
  } elseif (isset($value['include'])) {
@@ -155,6 +159,10 @@ final class PPHPUtility
155
159
  continue;
156
160
  }
157
161
 
162
+ if (self::isAtomicOperationArray($value)) {
163
+ continue;
164
+ }
165
+
158
166
  $isRelatedModel = false;
159
167
  foreach ($fields as $field) {
160
168
  $isObject = ($field['kind'] ?? null) === 'object';
@@ -190,6 +198,17 @@ final class PPHPUtility
190
198
  }
191
199
  }
192
200
 
201
+ private static function isAtomicOperationArray(array $arr): bool
202
+ {
203
+ $atomicOps = ['increment', 'decrement', 'multiply', 'divide'];
204
+ foreach ($arr as $key => $value) {
205
+ if (in_array($key, $atomicOps, true)) {
206
+ return true;
207
+ }
208
+ }
209
+ return false;
210
+ }
211
+
193
212
  private static function fieldExists(string $key, array $fields): bool
194
213
  {
195
214
  foreach ($fields as $field) {
@@ -344,7 +363,23 @@ final class PPHPUtility
344
363
 
345
364
  private static function isOperatorArray(array $arr)
346
365
  {
347
- $operators = ['contains', 'startsWith', 'endsWith', 'equals', 'not', 'gt', 'gte', 'lt', 'lte', 'in', 'notIn'];
366
+ $operators = [
367
+ 'contains',
368
+ 'startsWith',
369
+ 'endsWith',
370
+ 'equals',
371
+ 'not',
372
+ 'gt',
373
+ 'gte',
374
+ 'lt',
375
+ 'lte',
376
+ 'in',
377
+ 'notIn',
378
+ 'increment',
379
+ 'decrement',
380
+ 'multiply',
381
+ 'divide'
382
+ ];
348
383
  foreach ($arr as $key => $value) {
349
384
  if (!in_array($key, $operators)) {
350
385
  return false;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "prisma-client-php",
3
3
  "description": "Prisma Client PHP is an auto-generated query builder that enables type-safe database access in PHP.",
4
- "version": "3.0.2",
4
+ "version": "3.0.3",
5
5
  "main": "index.js",
6
6
  "type": "module",
7
7
  "scripts": {