Skip to content

Commit

Permalink
fix issue with multiple fields identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
rande committed Jun 25, 2014
1 parent ee232aa commit 6f89ad7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Form/DataTransformer/ModelToIdTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ public function transform($entity)
return null;
}

return current($this->modelManager->getIdentifierValues($entity));
return $this->modelManager->getNormalizedIdentifier($entity);
}
}
4 changes: 2 additions & 2 deletions Tests/Form/DataTransformer/ModelToIdTransformerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ public function getReverseTransformValues()
public function testTransform()
{
$this->modelManager->expects($this->once())
->method('getIdentifierValues')
->will($this->returnValue(array(123)));
->method('getNormalizedIdentifier')
->will($this->returnValue(123));

$transformer = new ModelToIdTransformer($this->modelManager, 'TEST');

Expand Down

0 comments on commit 6f89ad7

Please sign in to comment.