diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Doctrine/Mapping')
-rw-r--r-- | src/Wallabag/CoreBundle/Doctrine/Mapping/PrefixedNamingStrategy.php | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/Wallabag/CoreBundle/Doctrine/Mapping/PrefixedNamingStrategy.php b/src/Wallabag/CoreBundle/Doctrine/Mapping/PrefixedNamingStrategy.php index 861a60ea..509348db 100644 --- a/src/Wallabag/CoreBundle/Doctrine/Mapping/PrefixedNamingStrategy.php +++ b/src/Wallabag/CoreBundle/Doctrine/Mapping/PrefixedNamingStrategy.php | |||
@@ -25,7 +25,7 @@ class PrefixedNamingStrategy implements NamingStrategy | |||
25 | */ | 25 | */ |
26 | public function classToTableName($className) | 26 | public function classToTableName($className) |
27 | { | 27 | { |
28 | return strtolower($this->prefix . substr($className, strrpos($className, '\\') + 1)); | 28 | return strtolower($this->prefix.substr($className, strrpos($className, '\\') + 1)); |
29 | } | 29 | } |
30 | 30 | ||
31 | /** | 31 | /** |
@@ -49,7 +49,7 @@ class PrefixedNamingStrategy implements NamingStrategy | |||
49 | */ | 49 | */ |
50 | public function joinColumnName($propertyName) | 50 | public function joinColumnName($propertyName) |
51 | { | 51 | { |
52 | return $propertyName . '_' . $this->referenceColumnName(); | 52 | return $propertyName.'_'.$this->referenceColumnName(); |
53 | } | 53 | } |
54 | 54 | ||
55 | /** | 55 | /** |
@@ -62,7 +62,7 @@ class PrefixedNamingStrategy implements NamingStrategy | |||
62 | // ie: not "wallabag_entry_wallabag_tag" but "wallabag_entry_tag" | 62 | // ie: not "wallabag_entry_wallabag_tag" but "wallabag_entry_tag" |
63 | $target = substr($targetEntity, strrpos($targetEntity, '\\') + 1); | 63 | $target = substr($targetEntity, strrpos($targetEntity, '\\') + 1); |
64 | 64 | ||
65 | return strtolower($this->classToTableName($sourceEntity) . '_' .$target); | 65 | return strtolower($this->classToTableName($sourceEntity).'_'.$target); |
66 | } | 66 | } |
67 | 67 | ||
68 | /** | 68 | /** |
@@ -70,6 +70,14 @@ class PrefixedNamingStrategy implements NamingStrategy | |||
70 | */ | 70 | */ |
71 | public function joinKeyColumnName($entityName, $referencedColumnName = null) | 71 | public function joinKeyColumnName($entityName, $referencedColumnName = null) |
72 | { | 72 | { |
73 | return strtolower($this->classToTableName($entityName) . '_' .($referencedColumnName ?: $this->referenceColumnName())); | 73 | return strtolower($this->classToTableName($entityName).'_'.($referencedColumnName ?: $this->referenceColumnName())); |
74 | } | ||
75 | |||
76 | /** | ||
77 | * {@inheritdoc} | ||
78 | */ | ||
79 | public function embeddedFieldToColumnName($propertyName, $embeddedColumnName, $className = null, $embeddedClassName = null) | ||
80 | { | ||
81 | return $propertyName.'_'.$embeddedColumnName; | ||
74 | } | 82 | } |
75 | } | 83 | } |