mirror of
https://github.com/doctrine/orm.git
synced 2026-04-26 07:58:09 +02:00
Compare commits
29 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 984535cadc | |||
| 35a579efdc | |||
| a2b4e5b293 | |||
| 24d95796bb | |||
| 249b737094 | |||
| 36dc28d43e | |||
| 0ec9e53c8d | |||
| aa80f6c0b5 | |||
| fd6d4890c4 | |||
| c78afd5172 | |||
| fb7b78c004 | |||
| 0de69e5a80 | |||
| d7e1f883d8 | |||
| 82e0d7e21a | |||
| 26880983fc | |||
| d9899732ca | |||
| 4f96fc62ce | |||
| 6184343fd5 | |||
| ee22be27a5 | |||
| 8f77210955 | |||
| f736acc8f5 | |||
| f1534610e1 | |||
| 6622bbbbf3 | |||
| 1554af0c07 | |||
| 814aa9f322 | |||
| f311dd1dd1 | |||
| e3aa3f2d1d | |||
| c83f479633 | |||
| 741f1db198 |
+3
-3
@@ -17,13 +17,13 @@
|
||||
"ext-pdo": "*",
|
||||
"doctrine/collections": "~1.2",
|
||||
"doctrine/dbal": ">=2.5-dev,<2.7-dev",
|
||||
"doctrine/instantiator": "~1.0.1",
|
||||
"doctrine/instantiator": "^1.0.1",
|
||||
"doctrine/common": ">=2.5-dev,<2.9-dev",
|
||||
"doctrine/cache": "~1.4",
|
||||
"symfony/console": "~2.5|~3.0"
|
||||
"symfony/console": "~2.5|~3.0|~4.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/yaml": "~2.3|~3.0",
|
||||
"symfony/yaml": "~2.3|~3.0|~4.0",
|
||||
"phpunit/phpunit": "~4.0"
|
||||
},
|
||||
"suggest": {
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -811,7 +811,8 @@ class XmlDriver extends FileDriver
|
||||
protected function loadMappingFile($file)
|
||||
{
|
||||
$result = array();
|
||||
$xmlElement = simplexml_load_file($file);
|
||||
// Note: we do not use `simplexml_load_file()` because of https://bugs.php.net/bug.php?id=62577
|
||||
$xmlElement = simplexml_load_string(file_get_contents($file));
|
||||
|
||||
if (isset($xmlElement->entity)) {
|
||||
foreach ($xmlElement->entity as $entityElement) {
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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 ';
|
||||
|
||||
@@ -36,7 +36,7 @@ class Version
|
||||
/**
|
||||
* Current Doctrine Version
|
||||
*/
|
||||
const VERSION = '2.5.5-DEV';
|
||||
const VERSION = '2.5.12';
|
||||
|
||||
/**
|
||||
* Compares a Doctrine version with the current one.
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\ORM\Functional\Ticket;
|
||||
|
||||
use Doctrine\ORM\Events;
|
||||
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->getMockBuilder('Doctrine\DBAL\Connection')->disableOriginalConstructor()->getMock();
|
||||
$mockEntityManagerInterface = $this->getMock('Doctrine\ORM\EntityManagerInterface');
|
||||
$mockEventManager = $this->getMock('Doctrine\Common\EventManager');
|
||||
$mockStatement = $this->getMock('Doctrine\DBAL\Driver\Statement');
|
||||
$mockResultMapping = $this->getMock('Doctrine\ORM\Query\ResultSetMapping');
|
||||
|
||||
$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('Doctrine\ORM\Internal\Hydration\AbstractHydrator')
|
||||
->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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user