Merge branch 'DDC-1777'
This commit is contained in:
commit
48aba0a3f0
@ -1524,6 +1524,10 @@ class BasicEntityPersister
|
||||
{
|
||||
$criteria = $this->_class->getIdentifierValues($entity);
|
||||
|
||||
if ( ! $criteria) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($extraConditions) {
|
||||
$criteria = array_merge($criteria, $extraConditions);
|
||||
}
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user