Compare commits

..

13 Commits

Author SHA1 Message Date
Marco Pivetta 4f96fc62ce Preparing v2.5.9 release 2017-08-16 15:30:32 +02:00
Marco Pivetta 6184343fd5 Merge branch 'fix/#6626-skip-proxy-generation-for-embeddable-classes-2.5' into 2.5
Backport #6626
Backport #6625
2017-08-16 15:21:29 +02:00
Marco Pivetta ee22be27a5 #6625 #6626 removing PHP 5.3 incompatibilities (required for backport) 2017-08-16 15:21:14 +02:00
Marco Pivetta 8f77210955 #6626 #6625 minor CS fixes (removed useless assignments) 2017-08-16 15:20:10 +02:00
Issei.M f736acc8f5 Replace double quote with single quote 2017-08-16 15:20:01 +02:00
Issei.M f1534610e1 Fix CS / Add annotation 2017-08-16 15:18:15 +02:00
Issei.M 6622bbbbf3 Skip embeddable classes proxy generation 2017-08-16 15:18:04 +02:00
Marco Pivetta 1554af0c07 Merge branch 'fix/#6623-#1515-ensure-abstracthydrator-hydrateall-cleans-up-on-unit-of-work-clear-2.5' into 2.5
Close #6623
2017-08-16 14:50:13 +02:00
Nikolas Tsiongas 814aa9f322 fix AbstractHydrator addEventListener on hydrateAll() 2017-08-16 14:49:22 +02:00
Marco Pivetta f311dd1dd1 Bumping development version to v2.5.9-DEV 2017-08-13 20:47:26 +02:00
Marco Pivetta e3aa3f2d1d Preparing v2.5.8 release 2017-08-13 20:46:56 +02:00
Marco Pivetta c83f479633 Merge pull request #6621 from Powerhamster/patch-1
fixed undefined variable
2017-08-13 20:27:18 +02:00
Thomas Rothe 741f1db198 fixed undefined variable
changed $conditions to $condition so $isConditionalJoin is working
2017-08-12 11:33:11 +02:00
6 changed files with 103 additions and 3 deletions
@@ -142,6 +142,9 @@ abstract class AbstractHydrator
$this->_rsm = $resultSetMapping;
$this->_hints = $hints;
$evm = $this->_em->getEventManager();
$evm->addEventListener(array(Events::onClear), $this);
$this->prepare();
$result = $this->hydrateAllData();
+3 -1
View File
@@ -91,7 +91,9 @@ class ProxyFactory extends AbstractProxyFactory
protected function skipClass(ClassMetadata $metadata)
{
/* @var $metadata \Doctrine\ORM\Mapping\ClassMetadataInfo */
return $metadata->isMappedSuperclass || $metadata->getReflectionClass()->isAbstract();
return $metadata->isMappedSuperclass
|| $metadata->isEmbeddedClass
|| $metadata->getReflectionClass()->isAbstract();
}
/**
+1 -1
View File
@@ -1143,7 +1143,7 @@ class SqlWalker implements TreeWalker
$dqlAlias = $joinDeclaration->aliasIdentificationVariable;
$tableAlias = $this->getSQLTableAlias($class->table['name'], $dqlAlias);
$condition = '(' . $this->walkConditionalExpression($join->conditionalExpression) . ')';
$isUnconditionalJoin = empty($conditions);
$isUnconditionalJoin = empty($condition);
$condExprConjunction = ($class->isInheritanceTypeJoined() && $joinType != AST\Join::JOIN_TYPE_LEFT && $joinType != AST\Join::JOIN_TYPE_LEFTOUTER && $isUnconditionalJoin)
? ' AND '
: ' ON ';
+1 -1
View File
@@ -36,7 +36,7 @@ class Version
/**
* Current Doctrine Version
*/
const VERSION = '2.5.5-DEV';
const VERSION = '2.5.9';
/**
* Compares a Doctrine version with the current one.
@@ -0,0 +1,68 @@
<?php
namespace Doctrine\Tests\ORM\Functional\Ticket;
use Doctrine\DBAL\Connection;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\Common\EventManager;
use Doctrine\DBAL\Driver\Statement;
use Doctrine\ORM\Events;
use Doctrine\ORM\Query\ResultSetMapping;
use Doctrine\ORM\Internal\Hydration\AbstractHydrator;
use Doctrine\Tests\OrmFunctionalTestCase;
/**
* @covers \Doctrine\ORM\Internal\Hydration\AbstractHydrator
*/
class AbstractHydratorTest extends OrmFunctionalTestCase
{
/**
* @group DDC-3146
* @group #1515
*
* Verify that the number of added events to the event listener from the abstract hydrator class is equal to the
* number of removed events
*/
public function testOnClearEventListenerIsDetachedOnCleanup()
{
$mockConnection = $this->createMock(Connection::class);
$mockEntityManagerInterface = $this->createMock(EntityManagerInterface::class);
$mockEventManager = $this->createMock(EventManager::class);
$mockStatement = $this->createMock(Statement::class);
$mockResultMapping = $this->getMockBuilder(ResultSetMapping::class);
$mockEntityManagerInterface->expects(self::any())->method('getEventManager')->willReturn($mockEventManager);
$mockEntityManagerInterface->expects(self::any())->method('getConnection')->willReturn($mockConnection);
$mockStatement->expects(self::once())->method('fetch')->willReturn(false);
/* @var $mockAbstractHydrator AbstractHydrator */
$mockAbstractHydrator = $this
->getMockBuilder(AbstractHydrator::class)
->setConstructorArgs([$mockEntityManagerInterface])
->setMethods(['hydrateAllData'])
->getMock();
$mockEventManager
->expects(self::at(0))
->method('addEventListener')
->with([Events::onClear], $mockAbstractHydrator);
$mockEventManager
->expects(self::at(1))
->method('removeEventListener')
->with([Events::onClear], $mockAbstractHydrator);
$mockEventManager
->expects(self::at(2))
->method('addEventListener')
->with([Events::onClear], $mockAbstractHydrator);
$mockEventManager
->expects(self::at(3))
->method('removeEventListener')
->with([Events::onClear], $mockAbstractHydrator);
iterator_to_array($mockAbstractHydrator->iterate($mockStatement, $mockResultMapping));
$mockAbstractHydrator->hydrateAll($mockStatement, $mockResultMapping);
}
}
@@ -71,6 +71,33 @@ class ProxyFactoryTest extends \Doctrine\Tests\OrmTestCase
$proxy->getDescription();
}
public function testSkipMappedSuperClassesOnGeneration()
{
$cm = new ClassMetadata('stdClass');
$cm->isMappedSuperclass = true;
self::assertSame(
0,
$this->proxyFactory->generateProxyClasses([$cm]),
'No proxies generated.'
);
}
/**
* @group 6625
*/
public function testSkipEmbeddableClassesOnGeneration()
{
$cm = new ClassMetadata('stdClass');
$cm->isEmbeddedClass = true;
self::assertSame(
0,
$this->proxyFactory->generateProxyClasses([$cm]),
'No proxies generated.'
);
}
/**
* @group DDC-1771
*/