Skip to content

Commit

Permalink
DefaultProcessor: call unset() for mapped object properties only in R…
Browse files Browse the repository at this point in the history
…equiredFields::none() mode (performance optimization)
mabar committed Jan 21, 2025
1 parent c380527 commit 76f32b8
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -58,6 +58,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- automatic meta cache reset after main `process()` call (performance optimization) replaced with `reset()`
method
- properties are not set/unset via closure binding when public
- call `unset()` for mapped object properties only in `RequiredFields::none()` mode (performance optimization)

### Removed

9 changes: 6 additions & 3 deletions src/Processing/DefaultProcessor.php
Original file line number Diff line number Diff line change
@@ -552,10 +552,13 @@ private function fillObject(
$this->rawValuesMap->setRawValues($object, $rawData);
}

// Reset mapped properties state
$fieldsMeta = $meta->getFields();
foreach ($fieldsMeta as $fieldMeta) {
$this->objectUnset($object, $fieldMeta->getProperty());

if ($dynamic->getOptions()->getRequiredFields() === RequiredFields::none()) {
// Reset mapped properties state
foreach ($fieldsMeta as $fieldMeta) {
$this->objectUnset($object, $fieldMeta->getProperty());
}
}

// Set processed data

0 comments on commit 76f32b8

Please sign in to comment.