private function keyPerEntityRequired(\ReflectionClass $reflectionClass)
    {
        $classMetadata = $this->getEncryptionMetadataFor($reflectionClass->getName());

        $keyPerEntityModes = array(
            EncryptionService::MODE_PER_USER_SHAREABLE,
            EncryptionService::MODE_SYSTEM_ENCRYPTION,
        );

        return $classMetadata->encryptionEnabled
            && in_array($classMetadata->encryptionMode, $keyPerEntityModes);
    }