Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/Subscribers/DoctrineEncryptSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function restoreEncryptor()
*/
public function postUpdate(LifecycleEventArgs $args)
{
$entity = $args->getEntity();
$entity = $args->getObject();
$this->processFields($entity, false);
}

Expand All @@ -133,7 +133,7 @@ public function postUpdate(LifecycleEventArgs $args)
*/
public function preUpdate(PreUpdateEventArgs $args)
{
$entity = $args->getEntity();
$entity = $args->getObject();
$this->processFields($entity);
}

Expand All @@ -145,7 +145,7 @@ public function preUpdate(PreUpdateEventArgs $args)
*/
public function postLoad(LifecycleEventArgs $args)
{
$entity = $args->getEntity();
$entity = $args->getObject();
$this->processFields($entity, false);
}

Expand All @@ -157,7 +157,7 @@ public function postLoad(LifecycleEventArgs $args)
*/
public function preFlush(PreFlushEventArgs $preFlushEventArgs)
{
$unitOfWOrk = $preFlushEventArgs->getEntityManager()->getUnitOfWork();
$unitOfWOrk = $preFlushEventArgs->getObjectManagerr()->getUnitOfWork();
foreach ($unitOfWOrk->getIdentityMap() as $entityName => $entityArray) {
if (isset($this->cachedDecryptions[$entityName])) {
foreach ($entityArray as $entityId => $instance) {
Expand All @@ -176,12 +176,12 @@ public function preFlush(PreFlushEventArgs $preFlushEventArgs)
*/
public function onFlush(OnFlushEventArgs $onFlushEventArgs)
{
$unitOfWork = $onFlushEventArgs->getEntityManager()->getUnitOfWork();
$unitOfWork = $onFlushEventArgs->getObjectManager()->getUnitOfWork();
foreach ($unitOfWork->getScheduledEntityInsertions() as $entity) {
$encryptCounterBefore = $this->encryptCounter;
$this->processFields($entity);
if ($this->encryptCounter > $encryptCounterBefore ) {
$classMetadata = $onFlushEventArgs->getEntityManager()->getClassMetadata(get_class($entity));
$classMetadata = $onFlushEventArgs->getObjectManager()->getClassMetadata(get_class($entity));
$unitOfWork->recomputeSingleEntityChangeSet($classMetadata, $entity);
}
}
Expand All @@ -195,7 +195,7 @@ public function onFlush(OnFlushEventArgs $onFlushEventArgs)
*/
public function postFlush(PostFlushEventArgs $postFlushEventArgs)
{
$unitOfWork = $postFlushEventArgs->getEntityManager()->getUnitOfWork();
$unitOfWork = $postFlushEventArgs->getObjectManager()->getUnitOfWork();
foreach ($unitOfWork->getIdentityMap() as $entityMap) {
foreach ($entityMap as $entity) {
$this->processFields($entity, false);
Expand Down