Skip to content

Commit

Permalink
Issue with usage of __destruct to flush entities causing issues with …
Browse files Browse the repository at this point in the history
…sylius and possibly other bundles/solutions
  • Loading branch information
oliverde8 committed Aug 24, 2021
1 parent 3d48fb8 commit f1e8a48
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# 1.0.0 Alhpa #4

- :star2: Improved quality of the form builders. **THIS INTRODUCES A BC TO FORM PROVIDERS**
- :wrench: Issue with usage of __destruct to flush entities causing issues with sylius and possibly other bundles/solutions.

# 1.0.0 Alpha #3

Expand Down
8 changes: 3 additions & 5 deletions Storage/DoctrineEntityStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ public function save(string $configPath, string $scope, ?string $value)
} else {
$this->entityManager->persist($this->entities[$scope][$configPath]);
}

// TODO improve performance on this.
$this->entityManager->flush();
}

public function load(array $scopes): array
Expand All @@ -63,9 +66,4 @@ public function load(array $scopes): array

return $groupedConfigValues;
}

public function __destruct()
{
$this->entityManager->flush();
}
}

0 comments on commit f1e8a48

Please sign in to comment.