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 f3c9e2b commit 3b4a374Copy full SHA for 3b4a374
Lube/GeneratorBundle/Services/ImmutableAssociationService.php
@@ -32,10 +32,11 @@ public function markAssociationsReadOnly($entity)
32
if ($metadata->isSingleValuedAssociation($association))
33
{
34
$getter = Inflector::camelize('get_' . $association);
35
- $associated = $entity->$getter();
36
-
37
- if ($associated) {
38
- $this->em->getUnitOfWork()->markReadOnly($associated);
+ if (method_exists ($entity, $getter)) {
+ $associated = $entity->$getter();
+ if ($associated) {
+ $this->em->getUnitOfWork()->markReadOnly($associated);
39
+ }
40
}
41
42
0 commit comments