src/Encryption/EventListener/Entity/Encryptable/PreUpdateListener.php
public function preUpdate(PreUpdateEventArgs $args)
    {
        $entity = $args->getEntity();

        if (!$entity instanceof Encryptable) {
            return;
        }

        $this->encryptionService->encrypt($entity);
    }
public function preUpdate(PreUpdateEventArgs $args)
    {
        $entity = $args->getEntity();

        if (!$entity instanceof Encryptable) {
            return;
        }

        $this->encryptionService->encrypt($entity);
    }
Encrypt encryptable entity properties before saving in storage.

@param \Doctrine\ORM\Event\PreUpdateEventArgs $args