private function getClassMetadata(\ReflectionClass $reflectionClass)
    {
        /** @var ClassMetadata $classMetadata */
        $classMetadata = $this->getMetadataDriver()->loadMetadataForClass($reflectionClass);
        if (null === $classMetadata->encryptionMode) {
            $classMetadata->encryptionMode = $this->settings['default_mode'];
        }
        return $classMetadata;
    }