[PR #26] [MERGED] Add missing field for class metadata serialization (needed when using redis cache) #60

Closed
opened 2026-01-23 11:35:03 +01:00 by admin · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/doctrine/KeyValueStore/pull/26
Author: @web-party
Created: 5/19/2015
Status: Merged
Merged: 7/9/2015
Merged by: @beberlei

Base: masterHead: master


📝 Commits (1)

  • d168c89 Add missing field for class metadata serialization (needed when using redis cache)

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 lib/Doctrine/KeyValueStore/Mapping/ClassMetadata.php (+1 -1)

📄 Description

Original problem occurred with the following constellation:

<?php
use Doctrine\KeyValueStore\EntityManager;
use Doctrine\KeyValueStore\Configuration;
use Doctrine\KeyValueStore\Mapping\AnnotationDriver;
use Doctrine\KeyValueStore\Storage\DoctrineCacheStorage;
use Doctrine\Common\Cache\RedisCache;
use Doctrine\Common\Annotations\AnnotationReader;

$cache = new RedisCache();
$redis = new \Redis();
$redis->connect('localhost');
$cache->setRedis($redis);
$storage = new DoctrineCacheStorage($cache);

$reader = new AnnotationReader();
$metadata = new AnnotationDriver($reader);
$config = new Configuration();
$config->setMappingDriverImpl($metadata);
$config->setMetadataCache($cache);

$entityManager = new EntityManager($storage, $config);

// persisting for the first time OK
$product = new Product(); // entity with proper KV annotations (especially 'storageName')
$em->persist($product);
$em->flush(); // produces correct redis key, e.g. '[product-oid:id=123;][1]'
$product->addPrice(3.99);
// persisting next time not OK
$em->persist($product);
$em->flush(); // produces wrong redis key (storageName missing), e.g. '[-oid:id=123;][1]'

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/doctrine/KeyValueStore/pull/26 **Author:** [@web-party](https://github.com/web-party) **Created:** 5/19/2015 **Status:** ✅ Merged **Merged:** 7/9/2015 **Merged by:** [@beberlei](https://github.com/beberlei) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`d168c89`](https://github.com/doctrine/KeyValueStore/commit/d168c890ace4b224e883ffe186022baa5ac4675f) Add missing field for class metadata serialization (needed when using redis cache) ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `lib/Doctrine/KeyValueStore/Mapping/ClassMetadata.php` (+1 -1) </details> ### 📄 Description Original problem occurred with the following constellation: ``` php <?php use Doctrine\KeyValueStore\EntityManager; use Doctrine\KeyValueStore\Configuration; use Doctrine\KeyValueStore\Mapping\AnnotationDriver; use Doctrine\KeyValueStore\Storage\DoctrineCacheStorage; use Doctrine\Common\Cache\RedisCache; use Doctrine\Common\Annotations\AnnotationReader; $cache = new RedisCache(); $redis = new \Redis(); $redis->connect('localhost'); $cache->setRedis($redis); $storage = new DoctrineCacheStorage($cache); $reader = new AnnotationReader(); $metadata = new AnnotationDriver($reader); $config = new Configuration(); $config->setMappingDriverImpl($metadata); $config->setMetadataCache($cache); $entityManager = new EntityManager($storage, $config); // persisting for the first time OK $product = new Product(); // entity with proper KV annotations (especially 'storageName') $em->persist($product); $em->flush(); // produces correct redis key, e.g. '[product-oid:id=123;][1]' $product->addPrice(3.99); // persisting next time not OK $em->persist($product); $em->flush(); // produces wrong redis key (storageName missing), e.g. '[-oid:id=123;][1]' ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
admin added the pull-request label 2026-01-23 11:35:03 +01:00
admin closed this issue 2026-01-23 11:35:04 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/KeyValueStore#60