Merge remote branch 'hobodave/DDC-588'
This commit is contained in:
commit
73ff99c053
@ -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 {
|
||||
|
48
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC588Test.php
Normal file
48
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC588Test.php
Normal 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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user