Skip to content

Commit

Permalink
Update DoctrineORMAdapter.php (#1395)
Browse files Browse the repository at this point in the history
Replace the getEntityManager function with the getObjectManager function.
  • Loading branch information
laurentmuller committed Aug 10, 2023
1 parent 05f4df4 commit 3eff8b0
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/Adapter/ORM/DoctrineORMAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

namespace Vich\UploaderBundle\Adapter\ORM;

use Doctrine\ORM\Event\LifecycleEventArgs;
use Doctrine\Persistence\Event\LifecycleEventArgs as BaseLifecycleEventArgs;
use Doctrine\Persistence\Event\LifecycleEventArgs;
use Vich\UploaderBundle\Adapter\AdapterInterface;

/**
Expand All @@ -15,14 +14,11 @@
*/
final class DoctrineORMAdapter implements AdapterInterface
{
/**
* @param LifecycleEventArgs $event
*/
public function recomputeChangeSet(BaseLifecycleEventArgs $event): void
public function recomputeChangeSet(LifecycleEventArgs $event): void
{
$object = $event->getObject();

$em = $event->getEntityManager();
/** @var \Doctrine\ORM\EntityManagerInterface $em */
$em = $event->getObjectManager();
$uow = $em->getUnitOfWork();
$metadata = $em->getClassMetadata($object::class);
$uow->recomputeSingleEntityChangeSet($metadata, $object);
Expand Down

0 comments on commit 3eff8b0

Please sign in to comment.