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
> Увы, но я не владею английским, так что документация была составлена с помощью Google Translate :С
11
-
> Я буду рад, если вы поможете мне более грамотно описать документацию :)
12
10
13
11
Эта библиотека позволит вам легко преобразовать любой набор данных в нужный вам объект. От вас не требуется менять структуру классов, наследовать их от внешних модулей и т.д. Никаких танцев с бубнами - только данные и нужный класс.
> Alas, I do not speak English, and the documentation was compiled through google translator :( I will be glad if you can help me describe the documentation more correctly :)
11
16
12
17
This library will allow you to easily convert any data set into the object you need. You are not required to change the structure of classes, inherit them from external modules, etc. No dancing with tambourines - just data and the right class.
@@ -33,6 +38,7 @@ This is where this package comes to the rescue, which takes care of all the work
@@ -340,6 +349,17 @@ class CustomTransformUserDTOArray
340
349
}
341
350
```
342
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
+
343
363
### Comparison
344
364
I also made a comparison with current analogues and here are the main disadvantages
0 commit comments