From 80408ac34f9dcb0050d8eee13a54a406616e029c Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Mon, 2 Jan 2012 15:36:36 +0100 Subject: [PATCH] DCOM-93 - Add empty initialize and wakeup methods. --- .../ORM/Mapping/ClassMetadataFactory.php | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php b/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php index 6471df0fd..fdf57dbac 100644 --- a/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php +++ b/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php @@ -268,6 +268,7 @@ class ClassMetadataFactory implements ClassMetadataFactoryInterface } $class = $this->newClassMetadataInstance($className); + $this->initializeReflection($class, $this->getReflectionService()); if ($parent) { $class->setInheritanceType($parent->inheritanceType); @@ -289,6 +290,7 @@ class ClassMetadataFactory implements ClassMetadataFactoryInterface // Invoke driver try { $this->driver->loadMetadataForClass($className, $class); + $this->wakeupReflection($class, $this->getReflectionService()); } catch (ReflectionException $e) { throw MappingException::reflectionFailure($className, $e); } @@ -563,4 +565,26 @@ class ClassMetadataFactory implements ClassMetadataFactoryInterface { $this->reflectionService = $reflectionService; } + + /** + * Wakeup reflection after ClassMetadata gets unserialized from cache. + * + * @param ClassMetadata $class + * @param ReflectionService $reflService + * @return void + */ + protected function wakeupReflection(ClassMetadataInfo $class, ReflectionService $reflService) + { + } + + /** + * Initialize Reflection after ClassMetadata was constructed. + * + * @param ClassMetadata $class + * @param ReflectionSErvice $reflService + * @return void + */ + protected function initializeReflection(ClassMetadataInfo $class, ReflectionService $reflService) + { + } }