Skip to content

Commit 9ddabf5

Browse files
authored
Merge pull request #13 from ntidev/assoc-bug-fix
Association bug fix
2 parents 10108c3 + 6366989 commit 9ddabf5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/DataDog/AuditBundle/EventSubscriber/AuditSubscriber.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,15 +468,14 @@ protected function assoc(EntityManager $em, $association = null, $diff = false)
468468
}
469469

470470
$meta = get_class($association);
471-
$res = ['class' => $meta, 'typ' => $this->typ($meta), 'tbl' => null, 'label' => null];
471+
$res = ['class' => $meta, 'typ' => $this->typ($meta), 'tbl' => null, 'label' => null, 'createdOn' => new \DateTime()];
472472

473473
try {
474474
$meta = $em->getClassMetadata($meta);
475475
$res['tbl'] = $meta->table['name'];
476476
$em->getUnitOfWork()->initializeObject($association); // ensure that proxies are initialized
477477
$res['fk'] = $this->getUser() != null && $diff == false ? $this->getUser()->getId() : (string)$this->id($em, $association);
478478
$res['label'] = $this->label($em, $association, $diff);
479-
$res['createdOn'] = new \DateTime();
480479
} catch (\Exception $e) {
481480
$res['fk'] = (string) $association->getId();
482481
}

0 commit comments

Comments
 (0)