mirror of
https://github.com/doctrine/orm.git
synced 2026-04-25 15:38:10 +02:00
DDC-248: Exception is thrown during deserialization of the class 'ClassMetadata' if it contains child type #306
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Jan 11, 2010).
Jira issue originally created by user cloun:
I have a class hierarchy:
resource (id, type, name)
|---> module ()
|---> controller (ref to module)
---> action (ref to controller)
It is mapped with inheritamce type = "JOINED"
During the class ClassMetadata deserialization exception belows is thrown:
ReflectionException: Property id does not exist in E:\Projects\portal\library\Doctrine\ORM\Mapping\ClassMetadata.php on line 362
Call Stack:
0.0003 334120 1. {main}() E:\Projects\DoctrineTest\index.php:0
0.0291 2124544 2. Doctrine\ORM\EntityManager->find() E:\Projects\DoctrineTest\index.php:24
0.0291 2124544 3. Doctrine\ORM\EntityManager->getRepository() E:\Projects\portal\library\Doctrine\ORM\EntityManager.php:308
0.0291 2124544 4. Doctrine\ORM\EntityManager->getClassMetadata() E:\Projects\portal\library\Doctrine\ORM\EntityManager.php:489
0.0291 2124544 5. Doctrine\ORM\Mapping\ClassMetadataFactory->getMetadataFor() E:\Projects\portal\library\Doctrine\ORM\EntityManager.php:220
0.0291 2124608 6. Doctrine\Common\Cache\AbstractCache->fetch() E:\Projects\portal\library\Doctrine\ORM\Mapping\ClassMetadataFactory.php:133
0.0292 2124608 7. CacheDriver->_doFetch() E:\Projects\portal\library\Doctrine\Common\Cache\AbstractCache.php:89
0.0292 2124608 8. CacheDriver->init() E:\Projects\DoctrineTest\CacheDriver.php:61
0.0293 2127872 9. unserialize() E:\Projects\DoctrineTest\CacheDriver.php:49
0.0336 2609432 10. Doctrine\ORM\Mapping\ClassMetadata->**wakeup() E:\Projects\portal\library\Doctrine\ORM\Mapping\ClassMetadata.php:0
0.0340 2633128 11. ReflectionClass->getProperty() E:\Projects\portal\library\Doctrine\ORM\Mapping\ClassMetadata.php:362
I have attached file with sample code.. I hope it will be helpful
@doctrinebot commented on GitHub (Jan 11, 2010):
Comment created by cloun:
I have found workaround:
@doctrinebot commented on GitHub (Jan 11, 2010):
Comment created by cloun:
Sorry, but my workaround doesn't work =(
@doctrinebot commented on GitHub (Jan 15, 2010):
Comment created by wb:
The issue seems to be that ReflectionClass::getProperty() will only return properties that are defined directly by the class. The attached patch seems to resolve the issue for me.
@doctrinebot commented on GitHub (Jan 15, 2010):
Comment created by romanb:
Thanks for the patch but I think there is a better (faster) way to resolve this as we know when a field stems from a superclass and the name of that class.
I will commit a patch soon.
@doctrinebot commented on GitHub (Jan 15, 2010):
Comment created by romanb:
Should be fixed now.
@doctrinebot commented on GitHub (Jan 15, 2010):
Issue was closed with resolution "Fixed"
@doctrinebot commented on GitHub (Dec 13, 2015):
Imported 1 attachments from Jira into https://gist.github.com/dc6614ca813b2c141e6b