|
25 | 25 | use Doctrine\ORM\Event\PreUpdateEventArgs; |
26 | 26 | use Doctrine\ORM\PersistentCollection; |
27 | 27 | use Doctrine\Persistence\ManagerRegistry; |
| 28 | +use Doctrine\Persistence\ObjectManager; |
28 | 29 | use Doctrine\Persistence\ObjectRepository; |
29 | 30 | use Silverback\ApiComponentsBundle\Entity\Component\Collection; |
30 | 31 | use Silverback\ApiComponentsBundle\Entity\Core\ComponentPosition; |
@@ -58,7 +59,7 @@ public function preUpdate(PreUpdateEventArgs $eventArgs): void |
58 | 59 | $this->collectUpdatedResource($object, 'updated'); |
59 | 60 |
|
60 | 61 | $changeSet = $eventArgs->getEntityChangeSet(); |
61 | | - $associationMappings = $this->getAssociationMappings($eventArgs->getEntityManager(), $eventArgs->getObject()); |
| 62 | + $associationMappings = $this->getAssociationMappings($eventArgs->getObjectManager(), $eventArgs->getObject()); |
62 | 63 |
|
63 | 64 | if ($object instanceof PageDataInterface) { |
64 | 65 | $this->pageDataPropertiesChanged = array_keys($changeSet); |
@@ -99,7 +100,7 @@ public function postFlush(): void |
99 | 100 | $this->purgeResources(); |
100 | 101 | } |
101 | 102 |
|
102 | | - private function gatherRelationResourceClasses(EntityManagerInterface $em, $entity): void |
| 103 | + private function gatherRelationResourceClasses(ObjectManager $em, $entity): void |
103 | 104 | { |
104 | 105 | $associationMappings = $this->getAssociationMappings($em, $entity); |
105 | 106 | foreach (array_keys($associationMappings) as $property) { |
@@ -155,12 +156,12 @@ private function gatherIrisForCollectionResources(): array |
155 | 156 | return $collectionResources; |
156 | 157 | } |
157 | 158 |
|
158 | | - private function getAssociationMappings(EntityManagerInterface $em, $entity): array |
| 159 | + private function getAssociationMappings(ObjectManager $em, $entity): array |
159 | 160 | { |
160 | 161 | return $em->getClassMetadata(ClassUtils::getClass($entity))->getAssociationMappings(); |
161 | 162 | } |
162 | 163 |
|
163 | | - private function collectUpdatedResource($resource, string $type, ?EntityManagerInterface $em = null, bool $gatherRelated = false): void |
| 164 | + private function collectUpdatedResource($resource, string $type, ?ObjectManager $em = null, bool $gatherRelated = false): void |
164 | 165 | { |
165 | 166 | if (!$resource) { |
166 | 167 | return; |
|
0 commit comments