private function hasEncryptionFieldsDoctrineMetadata(DoctrineClassMetadata $classMetadata)
    {
        $return = false;
        if (ClassMetadataInfo::INHERITANCE_TYPE_JOINED === $classMetadata->inheritanceType
            || ClassMetadataInfo::INHERITANCE_TYPE_SINGLE_TABLE === $classMetadata->inheritanceType) {
            $rootEntity = $classMetadata->rootEntityName;
            if ($rootEntity !== $classMetadata->getName()) {
                $rootEntityEncryptionMetadata = $this->getEncryptionMetadataFor($rootEntity);
                return $rootEntityEncryptionMetadata && $rootEntityEncryptionMetadata->encryptionEnabled;
            }
        }

        return $return;
    }