File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -58,9 +58,9 @@ class EntityToIdentifierTransformer implements DataTransformerInterface
58
58
public function __construct (ObjectManager $ entityManager , $ className )
59
59
{
60
60
$ this ->entityManager = $ entityManager ;
61
- $ this ->className = $ className ;
62
- $ this ->repository = $ this ->entityManager ->getRepository ( $ this -> className );
63
- $ this ->metadata = $ this ->entityManager -> getClassMetadata ( $ this -> className );
61
+ $ this ->repository = $ this -> entityManager -> getRepository ( $ className) ;
62
+ $ this ->metadata = $ this ->entityManager ->getClassMetadata ( $ className );
63
+ $ this ->className = $ this ->metadata -> getName ( );
64
64
65
65
if ($ this ->metadata ->isIdentifierComposite ) {
66
66
throw new InvalidArgumentException ('Expected an entity with a single identifier. ' );
@@ -86,9 +86,9 @@ public function transform($value)
86
86
throw new TransformationFailedException ('Expected an object. ' );
87
87
}
88
88
89
- $ class = ClassUtils::getClass ($ value );
89
+ $ className = ClassUtils::getClass ($ value );
90
90
91
- if ($ class !== $ this ->className ) {
91
+ if ($ className !== $ this ->className ) {
92
92
throw new TransformationFailedException (sprintf ('Expected entity %s. ' , $ this ->className ));
93
93
}
94
94
You can’t perform that action at this time.
0 commit comments