We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8fc44b6 commit 09430f7Copy full SHA for 09430f7
Lube/GeneratorBundle/Services/ImmutableAssociationService.php
@@ -32,9 +32,12 @@ public function markAssociationsReadOnly($entity)
32
if ($metadata->isSingleValuedAssociation($association))
33
{
34
$getter = Inflector::camelize('get_' . $association);
35
-
36
- $this->em->getUnitOfWork()->markReadOnly($entity->$getter());
+ $associated = $entity->getter();
+
37
+ if ($associated) {
38
+ $this->em->getUnitOfWork()->markReadOnly($associated);
39
+ }
40
}
41
42
-}
43
+}
0 commit comments