@@ -28,7 +28,7 @@ |
||
28 | 28 | $this->ExtraDataService->discoveryUser($entity); |
29 | 29 | $newEntity = $this->execute($entity, 'prePersist'); |
30 | 30 | if ($newEntity && $newEntity !== $entity) |
31 | - $this->replaceEntity($newEntity, $entity); |
|
31 | + $this->replaceEntity($newEntity, $entity); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | public function postUpdate(LifecycleEventArgs $args) |
@@ -27,8 +27,9 @@ discard block |
||
27 | 27 | $this->ExtraDataService->discoveryDevice($entity); |
28 | 28 | $this->ExtraDataService->discoveryUser($entity); |
29 | 29 | $newEntity = $this->execute($entity, 'prePersist'); |
30 | - if ($newEntity && $newEntity !== $entity) |
|
31 | - $this->replaceEntity($newEntity, $entity); |
|
30 | + if ($newEntity && $newEntity !== $entity) { |
|
31 | + $this->replaceEntity($newEntity, $entity); |
|
32 | + } |
|
32 | 33 | } |
33 | 34 | |
34 | 35 | public function postUpdate(LifecycleEventArgs $args) |
@@ -67,10 +68,12 @@ discard block |
||
67 | 68 | $service = $this->container->get($serviceName); |
68 | 69 | if (method_exists($service, $method)) { |
69 | 70 | $newEntity = $service->$method($entity); |
70 | - if ('prePersist' === $method && $newEntity) |
|
71 | - return $newEntity; |
|
72 | - if ('postPersist' === $method && $newEntity) |
|
73 | - $this->manager->refresh($newEntity); |
|
71 | + if ('prePersist' === $method && $newEntity) { |
|
72 | + return $newEntity; |
|
73 | + } |
|
74 | + if ('postPersist' === $method && $newEntity) { |
|
75 | + $this->manager->refresh($newEntity); |
|
76 | + } |
|
74 | 77 | } |
75 | 78 | } |
76 | 79 | return $entity; |