1
0
mirror of synced 2025-01-09 18:47:10 +03:00

Merge branch 'hotfix/DDC-3103-#1020-serialize-isEmbedded-in-class-metadata'

Close #1020
This commit is contained in:
Marco Pivetta 2014-04-29 13:16:02 +02:00
commit 27845088e3
2 changed files with 48 additions and 0 deletions

View File

@ -852,6 +852,10 @@ class ClassMetadataInfo implements ClassMetadata
$serialized[] = 'isMappedSuperclass'; $serialized[] = 'isMappedSuperclass';
} }
if ($this->isEmbeddedClass) {
$serialized[] = 'isEmbeddedClass';
}
if ($this->containsForeignIdentifier) { if ($this->containsForeignIdentifier) {
$serialized[] = 'containsForeignIdentifier'; $serialized[] = 'containsForeignIdentifier';
} }

View File

@ -0,0 +1,44 @@
<?php
namespace Doctrine\Tests\ORM\Functional\Ticket;
use Doctrine\ORM\Mapping\ClassMetadata;
/**
* @group DDC-3103
*/
class DDC3103Test extends \Doctrine\Tests\OrmFunctionalTestCase
{
/**
* @covers \Doctrine\ORM\Mapping\ClassMetadataInfo::__sleep
*/
public function testIssue()
{
$className = __NAMESPACE__ . '\\DDC3103ArticleId';
$classMetadata = new ClassMetadata($className);
$this->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;
}