Skip to content

Commit

Permalink
Change the dynamicDump for onetoone
Browse files Browse the repository at this point in the history
  • Loading branch information
jmeyo committed May 17, 2024
1 parent f14abad commit 0aadcc4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Component/DumperUpdater/DataSyncManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public function synchronizeData(array $appEntities, array $appEntitiesAliases, a
$dataArray[$entityItem->getId()] = $this->dynamicDump($entityItem);
}
$this->dumpFile($dataArray, $type);
$this->logSuccess(sprintf('Configuration has been dumped for static instances definition (%s)', $type));
$this->logSuccess(sprintf('Configuration has been dumped for dynamic instances definition (%s)', $type));
} else {

$this->logWarning(sprintf('Not dumping Asset entity: %s', $type));
Expand Down Expand Up @@ -179,7 +179,6 @@ public function synchronizeData(array $appEntities, array $appEntitiesAliases, a

foreach ($dataEntity as $keyAttr => $valAttr) {
$this->logCommand(sprintf('working on %s', $keyAttr));

if ($valAttr === null) {
$this->logWarning(sprintf('Skipping on %s as value is %s', $keyAttr, $valAttr));
continue;
Expand Down Expand Up @@ -525,7 +524,7 @@ public function dynamicDump($entity): array
// $data[$propertyName] = $value->format('Y-m-d H:i:s');
} elseif (is_object($value) && method_exists($value, 'getId')) {
$mapping = $metadata->associationMappings[$propertyName];
if ($mapping['type'] === ClassMetadataInfo::ONE_TO_ONE && !isset($mapping['mappedBy'])) continue;
if ($mapping['type'] === ClassMetadataInfo::ONE_TO_ONE && isset($mapping['mappedBy'])) continue;
$data[$propertyName] = $value->getId();
} elseif ($value instanceof \BackedEnum) {
$data[$propertyName] = $value->value;
Expand Down

0 comments on commit 0aadcc4

Please sign in to comment.