diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php index 62ea7bb9b..ba7a2d2df 100644 --- a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php +++ b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php @@ -852,6 +852,10 @@ class ClassMetadataInfo implements ClassMetadata $serialized[] = 'isMappedSuperclass'; } + if ($this->isEmbeddedClass) { + $serialized[] = 'isEmbeddedClass'; + } + if ($this->containsForeignIdentifier) { $serialized[] = 'containsForeignIdentifier'; } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3103Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3103Test.php new file mode 100644 index 000000000..bb9ccde17 --- /dev/null +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3103Test.php @@ -0,0 +1,44 @@ +createAnnotationDriver()->loadMetadataForClass($className, $classMetadata); + + $this->assertTrue( + $classMetadata->isEmbeddedClass, + 'The isEmbeddedClass property should be true from the mapping data.' + ); + + $this->assertTrue( + unserialize(serialize($classMetadata))->isEmbeddedClass, + 'The isEmbeddedClass property should still be true after serialization and unserialization.' + ); + } +} + +/** + * @Embeddable + */ +class DDC3103ArticleId +{ + /** + * @var string + * @Column(name="name", type="string", length=255) + */ + protected $nameValue; +}