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

Merge remote branch 'hobodave/DDC-588'

This commit is contained in:
Jonathan H. Wage 2010-05-14 15:53:18 -04:00
commit 73ff99c053
2 changed files with 49 additions and 1 deletions

View File

@ -1480,7 +1480,7 @@ class UnitOfWork implements PropertyChangedListener
$class = $this->_em->getClassMetadata(get_class($entity));
if ($this->getEntityState($entity) == self::STATE_MANAGED) {
$this->getEntityPersister($class->name)->refresh(
array_combine($class->getIdentifierColumnNames(), $this->_entityIdentifiers[$oid]),
array_combine($class->getIdentifierFieldNames(), $this->_entityIdentifiers[$oid]),
$entity
);
} else {

View File

@ -0,0 +1,48 @@
<?php
namespace Doctrine\Tests\ORM\Functional\Ticket;
require_once __DIR__ . '/../../../TestInit.php';
class DDC588Test extends \Doctrine\Tests\OrmFunctionalTestCase
{
protected function setUp()
{
parent::setUp();
$this->_schemaTool->createSchema(array(
$this->_em->getClassMetadata(__NAMESPACE__ . '\DDC588Site'),
));
}
public function testIssue()
{
$site = new DDC588Site('Foo');
$this->_em->persist($site);
$this->_em->flush();
// Following should not result in exception
$this->_em->refresh($site);
}
}
/**
* @Entity
*/
class DDC588Site
{
/**
* @Id
* @Column(type="integer", name="site_id")
* @GeneratedValue
*/
public $id;
/**
* @Column(type="string", length=45)
*/
protected $name = null;
public function __construct($name = '')
{
$this->name = $name;
}
}