From 2f3c816579968591291a60fc41c9b32284592dc8 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sat, 30 May 2015 13:40:39 +0200 Subject: Update naming strategy since Doctrine 2.5 See https://github.com/doctrine/doctrine2/commit/20fb8270dc3c84eceaf90979644fdfbe0b2e615e --- .../CoreBundle/Doctrine/Mapping/PrefixedNamingStrategy.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/Wallabag/CoreBundle/Doctrine/Mapping/PrefixedNamingStrategy.php') diff --git a/src/Wallabag/CoreBundle/Doctrine/Mapping/PrefixedNamingStrategy.php b/src/Wallabag/CoreBundle/Doctrine/Mapping/PrefixedNamingStrategy.php index 861a60ea..724812fd 100644 --- a/src/Wallabag/CoreBundle/Doctrine/Mapping/PrefixedNamingStrategy.php +++ b/src/Wallabag/CoreBundle/Doctrine/Mapping/PrefixedNamingStrategy.php @@ -72,4 +72,12 @@ class PrefixedNamingStrategy implements NamingStrategy { return strtolower($this->classToTableName($entityName) . '_' .($referencedColumnName ?: $this->referenceColumnName())); } + + /** + * {@inheritdoc} + */ + public function embeddedFieldToColumnName($propertyName, $embeddedColumnName, $className = null, $embeddedClassName = null) + { + return $propertyName.'_'.$embeddedColumnName; + } } -- cgit v1.2.3 From 4346a86068781f4acdeb574d7e2af08b77b58ea7 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sat, 30 May 2015 13:52:26 +0200 Subject: CS --- .../CoreBundle/Doctrine/Mapping/PrefixedNamingStrategy.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Wallabag/CoreBundle/Doctrine/Mapping/PrefixedNamingStrategy.php') diff --git a/src/Wallabag/CoreBundle/Doctrine/Mapping/PrefixedNamingStrategy.php b/src/Wallabag/CoreBundle/Doctrine/Mapping/PrefixedNamingStrategy.php index 724812fd..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 */ public function classToTableName($className) { - return strtolower($this->prefix . substr($className, strrpos($className, '\\') + 1)); + return strtolower($this->prefix.substr($className, strrpos($className, '\\') + 1)); } /** @@ -49,7 +49,7 @@ class PrefixedNamingStrategy implements NamingStrategy */ public function joinColumnName($propertyName) { - return $propertyName . '_' . $this->referenceColumnName(); + return $propertyName.'_'.$this->referenceColumnName(); } /** @@ -62,7 +62,7 @@ class PrefixedNamingStrategy implements NamingStrategy // ie: not "wallabag_entry_wallabag_tag" but "wallabag_entry_tag" $target = substr($targetEntity, strrpos($targetEntity, '\\') + 1); - return strtolower($this->classToTableName($sourceEntity) . '_' .$target); + return strtolower($this->classToTableName($sourceEntity).'_'.$target); } /** @@ -70,7 +70,7 @@ class PrefixedNamingStrategy implements NamingStrategy */ public function joinKeyColumnName($entityName, $referencedColumnName = null) { - return strtolower($this->classToTableName($entityName) . '_' .($referencedColumnName ?: $this->referenceColumnName())); + return strtolower($this->classToTableName($entityName).'_'.($referencedColumnName ?: $this->referenceColumnName())); } /** -- cgit v1.2.3