[TASK] Clean up DataMapper::convertClassNameToTableName 00/39900/3
authorMathias Brodala <mbrodala@pagemachine.de>
Tue, 2 Jun 2015 15:19:31 +0000 (17:19 +0200)
committerAndreas Fernandez <typo3@scripting-base.de>
Thu, 11 Jun 2015 08:51:13 +0000 (10:51 +0200)
This removes pointless code which ends up doing strtolower(NULL).

Also make the class name argument mandatory since it does not make
sense to pass nothing or NULL and the core does not do this in any
case.

The latter change makes this mildly breaking if code relies on the
old behavior.

Resolves: #67248
Releases: master
Change-Id: I3f3339ea005831fc3d78974d8883c20ad04ec4ec
Reviewed-on: http://review.typo3.org/39900
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
typo3/sysext/core/Documentation/Changelog/master/Important-67248-CleanUpDataMapperconvertClassNameToTableName.rst [new file with mode: 0644]
typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapper.php

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Important-67248-CleanUpDataMapperconvertClassNameToTableName.rst b/typo3/sysext/core/Documentation/Changelog/master/Important-67248-CleanUpDataMapperconvertClassNameToTableName.rst
new file mode 100644 (file)
index 0000000..7e7803f
--- /dev/null
@@ -0,0 +1,8 @@
+====================================================================
+Important: #67248 - Clean up DataMapper::convertClassNameToTableName
+====================================================================
+
+Description
+===========
+
+As a side effect of cleaning up ``DataMapper::convertClassNameToTableName`` the ``$className`` argument is now mandatory.
index 6dc88bc..d884f74 100644 (file)
@@ -545,13 +545,8 @@ class DataMapper implements \TYPO3\CMS\Core\SingletonInterface {
         * @param string $className
         * @return string The selector name
         */
-       public function convertClassNameToTableName($className = NULL) {
-               if ($className !== NULL) {
-                       $tableName = $this->getDataMap($className)->getTableName();
-               } else {
-                       $tableName = strtolower($className);
-               }
-               return $tableName;
+       public function convertClassNameToTableName($className) {
+               return $this->getDataMap($className)->getTableName();
        }
 
        /**