File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -48,12 +48,12 @@ public function loadClassMetadata(
48
48
return true ;
49
49
}
50
50
51
- $ doctrineClassMetaData = $ manager ->getClassMetadata ($ className );
52
- if (!$ doctrineClassMetaData ) {
51
+ $ doctrineClassMetadata = $ manager ->getClassMetadata ($ className );
52
+ if (!$ doctrineClassMetadata ) {
53
53
return true ;
54
54
}
55
55
56
- $ identifiers = $ doctrineClassMetaData ->getIdentifier ();
56
+ $ identifiers = $ doctrineClassMetadata ->getIdentifier ();
57
57
if (1 !== count ($ identifiers )) {
58
58
return true ;
59
59
}
@@ -63,6 +63,10 @@ public function loadClassMetadata(
63
63
if ($ attribute ->getName () === $ identifierName ) {
64
64
$ attribute ->setIdentifier (true );
65
65
66
+ if (!$ doctrineClassMetadata ->isIdentifierNatural ()) {
67
+ $ attribute ->setWritable (false );
68
+ }
69
+
66
70
return true ;
67
71
}
68
72
}
You can’t perform that action at this time.
0 commit comments