private function getEncryptionMode($entity)
    {
        $className = ClassUtils::getClass($entity);
        $classMetadata = $this->metadataFactory->getMetadataFor($className);

        return $classMetadata->encryptionMode;
    }