File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ of them to type-safe objects.
50
50
- [ Object creator] ( #object-creator )
51
51
- [ Create without constructor] ( #create-without-constructor )
52
52
- [ Metadata validation and preloading] ( #metadata-validation-and-preloading )
53
+ - [ Tracking input values] ( #tracking-input-values )
53
54
54
55
## Setup
55
56
@@ -1751,3 +1752,28 @@ $metaLoader->preloadFromPaths([
1751
1752
__DIR__ . '/path2',
1752
1753
]);
1753
1754
```
1755
+
1756
+ ## Tracking input values
1757
+
1758
+ Track input values of every mapped object in hierarchy, before they were processed by rules.
1759
+
1760
+ > Use only for debugging, because this may be memory intensive
1761
+
1762
+ ``` php
1763
+ use Orisai\ObjectMapper\Processing\Options;
1764
+
1765
+ $initialValues = [];
1766
+
1767
+ $options = new Options();
1768
+ $options->setTrackRawValues(true);
1769
+ $object = $processor->process($initialValues, TrackedInput::class, $options);
1770
+
1771
+ $values = $processor->getRawValues($object); // mixed
1772
+ $values === $initialValues; // true
1773
+ ```
1774
+
1775
+ To make it work,following conditions must be met:
1776
+
1777
+ - object was mapped by object mapper (no manually created objects)
1778
+ - it was mapped in current php process (no serialization)
1779
+ - option is set to enable raw values tracking
You can’t perform that action at this time.
0 commit comments