Skip to content

Commit

Permalink
don't apply if prefix exist
Browse files Browse the repository at this point in the history
  • Loading branch information
KornelKrupa authored and kayue committed Feb 13, 2018
1 parent 7289940 commit e7de722
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Subscriber/TablePrefixSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ public function loadClassMetadata(LoadClassMetadataEventArgs $args)
// set table prefix to associated entity
// TODO: make sure prefix won't apply to user table
foreach ($classMetadata->associationMappings as &$mapping) {
if (isset($mapping['joinTable']) && !empty($mapping['joinTable'])) {
$mapping['joinTable']['name'] = $prefix.$mapping['joinTable']['name'];
if (isset($mapping['joinTable']) && !empty($mapping['joinTable']) && strpos($mapping['joinTable']['name'], $prefix) !== 0) {
$mapping['joinTable']['name'] = $prefix . $mapping['joinTable']['name'];
}
}
}
Expand Down

0 comments on commit e7de722

Please sign in to comment.