Skip to content

Commit 6184343

Browse files
committed
Merge branch 'fix/#6626-skip-proxy-generation-for-embeddable-classes-2.5' into 2.5
Backport #6626 Backport #6625
2 parents 1554af0 + ee22be2 commit 6184343

2 files changed

Lines changed: 30 additions & 1 deletion

File tree

lib/Doctrine/ORM/Proxy/ProxyFactory.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ public function __construct(EntityManagerInterface $em, $proxyDir, $proxyNs, $au
9191
protected function skipClass(ClassMetadata $metadata)
9292
{
9393
/* @var $metadata \Doctrine\ORM\Mapping\ClassMetadataInfo */
94-
return $metadata->isMappedSuperclass || $metadata->getReflectionClass()->isAbstract();
94+
return $metadata->isMappedSuperclass
95+
|| $metadata->isEmbeddedClass
96+
|| $metadata->getReflectionClass()->isAbstract();
9597
}
9698

9799
/**

tests/Doctrine/Tests/ORM/Proxy/ProxyFactoryTest.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,33 @@ public function testReferenceProxyDelegatesLoadingToThePersister()
7171
$proxy->getDescription();
7272
}
7373

74+
public function testSkipMappedSuperClassesOnGeneration()
75+
{
76+
$cm = new ClassMetadata('stdClass');
77+
$cm->isMappedSuperclass = true;
78+
79+
self::assertSame(
80+
0,
81+
$this->proxyFactory->generateProxyClasses([$cm]),
82+
'No proxies generated.'
83+
);
84+
}
85+
86+
/**
87+
* @group 6625
88+
*/
89+
public function testSkipEmbeddableClassesOnGeneration()
90+
{
91+
$cm = new ClassMetadata('stdClass');
92+
$cm->isEmbeddedClass = true;
93+
94+
self::assertSame(
95+
0,
96+
$this->proxyFactory->generateProxyClasses([$cm]),
97+
'No proxies generated.'
98+
);
99+
}
100+
74101
/**
75102
* @group DDC-1771
76103
*/

0 commit comments

Comments
 (0)