andreaswolf / fractor

Generic File Read-Analyze-Change Tool
MIT License
27 stars 0 forks source link

FlexForm fractors: Add abstraction for column structure #142

Open andreaswolf opened 1 month ago

andreaswolf commented 1 month ago

Since traversing the XML structure for a single column requires XML operations e.g. for finding nodes and checking values, we should make the implicit structural knowledge explicit by creating a wrapper class for the structure. This would serve the same purpose as the current trait \a9f\Typo3Fractor\Helper\FlexFormHelperTrait.

The new class should accept a DOMNode for either the whole column configuration or the <config> sub node (the latter would make it easier to check if the correct column was passed in the constructor).

The class should have methods for retrieving the config type, render type, changing the TCA type, render type, …

Alternatively, we could also decide on not handling all this in XML, but converting the XML to a PHP array in the constructor and back to XML in a separate method (which is how the core handles this as well).

simonschaufi commented 1 month ago

I would love the xml to PHP transformation as it would make the rules so much easier as you could basically copy the tca migrations from the core then.