Task #103028
closedRefactoring DefaultTcaSchema to reduce redundant code
0%
Description
I would like to simplify the TYPO3\CMS\Core\Database\Schema\DefaultTcaSchema class by replacing all the "foreach ($tableDefinition['columns'] as $fieldName => $fieldConfig)" calls with one foreach. I would suggest a mapping class which returns the column type and its options depending on the given tca configuration.
Optional:- If wanted I could add an PSR-14 event allowing to override the column type and options with an event listener.
I already have a running prototype, if you think this would be useful I would finish it and update the tests if needed before I push it for a review.
P.S. I created this task to get startet in the TYPO3 contribution by getting to know the whole process.
Updated by Sven Wappler 8 months ago
Perhaps this would be a good reason to wish for the possibility to manipulate the table generation via extension. The background is that I would like to make the tag field type available in TYPO3, similar to category. For this it would be very practical if I only need to add the field to the various tables via TCA override, the necessary sql field would be added automatically.
Updated by Christian Kuhn 6 months ago
- Related to Feature #101553: Auto-create DB fields from TCA columns added
Updated by Christian Kuhn 6 months ago ยท Edited
events may be problematic in ext:install related code. the multiple foreach loops have been cleaned up with #104110.
Updated by Christian Kuhn 6 months ago
- Related to Task #104110: Streamline DefaultTcaSchema added
Updated by Christian Kuhn 5 months ago
- Status changed from New to Closed
hey. i hope its ok to close here: the many foreach have been cleaned up.