From bd0f3d32c9ccb8f7a1409edb960b909a5e6a096d Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sat, 24 Oct 2015 15:28:02 +0200 Subject: Quoted entity to avoid reserved keyword Should fix #1498 --- .../Doctrine/Mapping/PrefixedNamingStrategy.php | 83 ---------------------- 1 file changed, 83 deletions(-) delete mode 100644 src/Wallabag/CoreBundle/Doctrine/Mapping/PrefixedNamingStrategy.php (limited to 'src/Wallabag/CoreBundle/Doctrine') diff --git a/src/Wallabag/CoreBundle/Doctrine/Mapping/PrefixedNamingStrategy.php b/src/Wallabag/CoreBundle/Doctrine/Mapping/PrefixedNamingStrategy.php deleted file mode 100644 index 509348db..00000000 --- a/src/Wallabag/CoreBundle/Doctrine/Mapping/PrefixedNamingStrategy.php +++ /dev/null @@ -1,83 +0,0 @@ -prefix = (string) $prefix; - } - - /** - * {@inheritdoc} - */ - public function classToTableName($className) - { - return strtolower($this->prefix.substr($className, strrpos($className, '\\') + 1)); - } - - /** - * {@inheritdoc} - */ - public function propertyToColumnName($propertyName, $className = null) - { - return $propertyName; - } - - /** - * {@inheritdoc} - */ - public function referenceColumnName() - { - return 'id'; - } - - /** - * {@inheritdoc} - */ - public function joinColumnName($propertyName) - { - return $propertyName.'_'.$this->referenceColumnName(); - } - - /** - * {@inheritdoc} - */ - public function joinTableName($sourceEntity, $targetEntity, $propertyName = null) - { - // for join table we don't want to have both table concatenated AND prefixed - // we just want the whole table to prefixed once - // ie: not "wallabag_entry_wallabag_tag" but "wallabag_entry_tag" - $target = substr($targetEntity, strrpos($targetEntity, '\\') + 1); - - return strtolower($this->classToTableName($sourceEntity).'_'.$target); - } - - /** - * {@inheritdoc} - */ - public function joinKeyColumnName($entityName, $referencedColumnName = null) - { - 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