Skip to content

Commit

Permalink
target only fieldName key
Browse files Browse the repository at this point in the history
  • Loading branch information
kingjia90 authored Oct 9, 2024
1 parent a2862a2 commit ac9d31a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Mapping/DataTarget/Direct.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,13 @@ protected function checkAssignData($newData, $valueContainer, $getter)
$fieldName = $fieldNameParts[2];
}

try {
if ($this->fieldName === 'key'){
$currentDataIsEmpty = empty($currentData);
$newDataIsEmpty = empty($newData);
} else {
$fieldDefinition = $this->getFieldDefinition($valueContainer, $fieldName);
$currentDataIsEmpty = $fieldDefinition->isEmpty($currentData);
$newDataIsEmpty = $fieldDefinition->isEmpty($newData);
} catch (InvalidConfigurationException $e) {
$currentDataIsEmpty = empty($currentData);
$newDataIsEmpty = empty($newData);
}

if ($this->writeIfTargetIsNotEmpty === false && !$currentDataIsEmpty) {
Expand Down

0 comments on commit ac9d31a

Please sign in to comment.