baumrock / RockMigrations

The Ultimate Automation and Deployment-Tool for ProcessWire
MIT License
34 stars 10 forks source link

Repeatermatrix #30

Closed gebeer closed 1 year ago

gebeer commented 1 year ago

Hi, finally the PR for adding Repeater Matrix support. I tested this thoroughly and there are no issues that I am aware of. Also updated the readme.

Since Repeater Matrix fields need to be created in 2 steps (createField and setMatrixItems), I added a convenience method for that $rm->createRepeaterMatrixField() Added functionality for sorting the types in the correct order. Made addMatrixItem() a protected function since adding happens inside the 'matrixItems' array and I never had the need for that standalone method. Just in case people want that as a public method, I added a check for existing type. Otherwise types would be added even if they already existed. Also added docstrings to all methods.

I'd also like to add a wiki entry. How to go about that?

BernhardBaumrock commented 1 year ago

Merged manually due to conflicts.