Skip to content

Commit 09430f7

Browse files
authored
Update ImmutableAssociationService.php
1 parent 8fc44b6 commit 09430f7

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Lube/GeneratorBundle/Services/ImmutableAssociationService.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,12 @@ public function markAssociationsReadOnly($entity)
3232
if ($metadata->isSingleValuedAssociation($association))
3333
{
3434
$getter = Inflector::camelize('get_' . $association);
35-
36-
$this->em->getUnitOfWork()->markReadOnly($entity->$getter());
35+
$associated = $entity->getter();
36+
37+
if ($associated) {
38+
$this->em->getUnitOfWork()->markReadOnly($associated);
39+
}
3740
}
3841
}
3942
}
40-
}
43+
}

0 commit comments

Comments
 (0)