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
@@ -345,6 +349,17 @@ class CustomTransformUserDTOArray
345
349
}
346
350
```
347
351
352
+
### **Cache**
353
+
354
+
The package supports a class caching mechanism to avoid the cost of reflection. This functionality is recommended to be used only if you have very voluminous classes, or there is a cyclic transformation of multiple entities. On ordinary lightweight DTO, there will be only 5-10%, and this will be unnecessary access in the file system.
355
+
356
+
You can enable caching by passing the config to the hydrator constructor:
357
+
358
+
```php
359
+
(new Hydrator(new HydratorConfig(true)))
360
+
->create(PurchaseDto::class, $data);
361
+
```
362
+
348
363
### Comparison
349
364
I also made a comparison with current analogues and here are the main disadvantages
@@ -294,3 +299,15 @@ If you need to completely transform yourself, then you can create a transform me
294
299
$this->username = $args['fio'];
295
300
}
296
301
}
302
+
303
+
Cache
304
+
----------------
305
+
306
+
The package supports a class caching mechanism to avoid the cost of reflection. This functionality is recommended to be used only if you have very voluminous classes, or there is a cyclic transformation of multiple entities. On ordinary lightweight DTO, there will be only 5-10%, and this will be unnecessary access in the file system.
307
+
308
+
You can enable caching by passing the config to the hydrator constructor:
0 commit comments