File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -60,16 +60,14 @@ public function getContentId($content)
60
60
}
61
61
62
62
try {
63
- $ meta = $ this ->getObjectManager ()->getClassMetadata (get_class ($ content ));
63
+ $ class = get_class ($ content );
64
+ $ meta = $ this ->getObjectManager ()->getClassMetadata ($ class );
64
65
$ ids = $ meta ->getIdentifierValues ($ content );
65
- if (0 !== count ($ ids )) {
66
- throw new \Exception (' Multi identifier values not supported in ' . get_class ( $ content ));
66
+ if (1 !== count ($ ids )) {
67
+ throw new \Exception (sprintf ( ' Class "%s" must use only one identifier ' , $ class ));
67
68
}
68
69
69
- return implode (': ' , array (
70
- get_class ($ content ),
71
- reset ($ ids ),
72
- ));
70
+ return implode (': ' , array ($ class , reset ($ ids )));
73
71
} catch (\Exception $ e ) {
74
72
return ;
75
73
}
You can’t perform that action at this time.
0 commit comments