Fixed strange test case with CmsUser and second-level cache
This commit is contained in:
parent
5ec2014051
commit
1b4eee6d0d
@ -184,13 +184,13 @@ class DefaultCacheFactory implements CacheFactory
|
||||
if ($mapping['cache']) {
|
||||
$targetPersister = $em->getUnitOfWork()->getEntityPersister($mapping['targetEntity']);
|
||||
|
||||
if ($targetPersister instanceof CachedPersister) {
|
||||
if (! ($targetPersister instanceof CachedPersister)) {
|
||||
throw CacheException::nonCacheableEntity($mapping['targetEntity']);
|
||||
}
|
||||
$targetRegion = $targetPersister->getCacheRegion();
|
||||
|
||||
$targetRegion = $targetPersister->getCacheRegion();
|
||||
|
||||
if ($targetRegion instanceof MultiGetRegion) {
|
||||
return new MultiGetCollectionHydrator($em, $targetRegion);
|
||||
}
|
||||
if ($targetRegion instanceof MultiGetRegion) {
|
||||
return new MultiGetCollectionHydrator($em, $targetRegion);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -39,6 +39,10 @@ class ExtraLazyCollectionTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
$class->associationMappings['phonenumbers']['fetch'] = ClassMetadataInfo::FETCH_EXTRA_LAZY;
|
||||
$class->associationMappings['phonenumbers']['indexBy'] = 'phonenumber';
|
||||
|
||||
unset($class->associationMappings['phonenumbers']['cache']);
|
||||
unset($class->associationMappings['articles']['cache']);
|
||||
unset($class->associationMappings['users']['cache']);
|
||||
|
||||
$class = $this->_em->getClassMetadata('Doctrine\Tests\Models\CMS\CmsGroup');
|
||||
$class->associationMappings['users']['fetch'] = ClassMetadataInfo::FETCH_EXTRA_LAZY;
|
||||
$class->associationMappings['users']['indexBy'] = 'username';
|
||||
|
Loading…
x
Reference in New Issue
Block a user