Skip to content

Commit

Permalink
Merge remote branch 'hobodave/DDC-588'
Browse files Browse the repository at this point in the history
  • Loading branch information
jwage committed May 14, 2010
2 parents 29c8f17 + edf096e commit 73ff99c
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/UnitOfWork.php
Original file line number Diff line number Diff line change
Expand Up @@ -1480,7 +1480,7 @@ private function _doRefresh($entity, array &$visited)
$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 {
Expand Down
48 changes: 48 additions & 0 deletions tests/Doctrine/Tests/ORM/Functional/Ticket/DDC588Test.php
Original file line number Diff line number Diff line change
@@ -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;
}
}

0 comments on commit 73ff99c

Please sign in to comment.