1
0
mirror of synced 2024-12-14 15:16:04 +03:00

Merge branch 'DDC-1777'

This commit is contained in:
Benjamin Eberlei 2012-05-27 17:11:29 +02:00
commit 48aba0a3f0
2 changed files with 23 additions and 0 deletions

View File

@ -1524,6 +1524,10 @@ class BasicEntityPersister
{
$criteria = $this->_class->getIdentifierValues($entity);
if ( ! $criteria) {
return false;
}
if ($extraConditions) {
$criteria = array_merge($criteria, $extraConditions);
}

View File

@ -448,4 +448,23 @@ class ClassTableInheritanceTest extends \Doctrine\Tests\OrmFunctionalTestCase
$manager = $this->_em->find('Doctrine\Tests\Models\Company\CompanyManager', $manager->getId());
$this->assertEquals(1, count($manager->getFriends()));
}
/**
* @group DDC-1777
*/
public function testExistsSubclass()
{
$manager = new CompanyManager();
$manager->setName('gblanco');
$manager->setSalary(1234);
$manager->setTitle('Awesome!');
$manager->setDepartment('IT');
$this->assertFalse($this->_em->getUnitOfWork()->getEntityPersister(get_class($manager))->exists($manager));
$this->_em->persist($manager);
$this->_em->flush();
$this->assertTrue($this->_em->getUnitOfWork()->getEntityPersister(get_class($manager))->exists($manager));
}
}