Task #67248

Clean up DataMapper::convertClassNameToTableName

Added by Mathias Brodala about 4 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Should have
Category:
Code Cleanup
Target version:
Start date:
2015-06-02
Due date:
% Done:

100%

TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

The source of DataMapper:: currently reads:

public function convertClassNameToTableName($className = NULL) {
  if ($className !== NULL) {
    $tableName = $this->getDataMap($className)->getTableName();
  } else {
    $tableName = strtolower($className);
  }
  return $tableName;
}

This is pointless since every non-NULL value returns the table name from a matching DataMap and every NULL value is processed with strtolower. This should be removed.

It also does not make sense to make the $className parameter optional.

Associated revisions

Revision 4b97b6a8 (diff)
Added by Mathias Brodala about 4 years ago

[TASK] Clean up DataMapper::convertClassNameToTableName

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 <>
Tested-by: Christian Kuhn <>
Reviewed-by: Wouter Wolters <>
Reviewed-by: Andreas Fernandez <>
Tested-by: Andreas Fernandez <>

History

#1 Updated by Gerrit Code Review about 4 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/39900

#2 Updated by Gerrit Code Review about 4 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/39900

#3 Updated by Mathias Brodala about 4 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 50 to 100

#4 Updated by Riccardo De Contardi over 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF