Skip to content

Commit 3b4a374

Browse files
authored
Update ImmutableAssociationService.php
1 parent f3c9e2b commit 3b4a374

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Lube/GeneratorBundle/Services/ImmutableAssociationService.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@ public function markAssociationsReadOnly($entity)
3232
if ($metadata->isSingleValuedAssociation($association))
3333
{
3434
$getter = Inflector::camelize('get_' . $association);
35-
$associated = $entity->$getter();
36-
37-
if ($associated) {
38-
$this->em->getUnitOfWork()->markReadOnly($associated);
35+
if (method_exists ($entity, $getter)) {
36+
$associated = $entity->$getter();
37+
if ($associated) {
38+
$this->em->getUnitOfWork()->markReadOnly($associated);
39+
}
3940
}
4041
}
4142
}

0 commit comments

Comments
 (0)