Skip to content

Commit

Permalink
Merge pull request #28 from whitedigital-eu/fix/fix-collection-bug
Browse files Browse the repository at this point in the history
fix: fix bug when audit throws error while setting collection items
  • Loading branch information
acirulis authored Jun 6, 2023
2 parents 654dcb9 + fea4ae6 commit 8e8aefb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/EventSubscriber/AuditDoctrineEventSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ private function logActivity(string $event, string $action, LifecycleEventArgs $

private function normalizeEntityCollections(mixed $entity): array|int|string
{
if ($entity instanceof PersistentCollection) {
$entity = $entity->toArray();
}

return array_map(static function ($value) {
if ($value instanceof PersistentCollection) {
$collectionValue = [];
Expand Down

0 comments on commit 8e8aefb

Please sign in to comment.