public function processEntityPostPersist($entity)
    {
        $userClasses = $this->settings['user_classes'];
        foreach ($userClasses as $userClass) {
            if (class_exists($userClass) && $entity instanceof $userClass) {
                $relatedEntities = $this->getUserRelatedEntities($entity);
                foreach ($relatedEntities as $relatedEntity) {
                    $classMetadata = $this->getEncryptionMetadataFor(ClassUtils::getClass($relatedEntity));
                    if (EncryptionService::MODE_PER_USER_SHAREABLE === $classMetadata->encryptionMode) {
                        $encryptionKey = $relatedEntity->getKey();
                        if ($encryptionKey) {
                            $encryptionKey->updateUnidentifiedKey($entity);
                        }
                    }
                }
            }
        }

        // Now we have to decrypt the entity once again to be able to work with it from this moment
        $this->processEntity($entity, self::DECRYPT);
    }