I want to save store configuration programtically but I'm just getting one problem after another. Firstly I wanted to use
Writer class but since it only updates
core_config_data table it doesn't work with more complex models like the one I want to update. Since updating the config by path works via
bin/magento config:set I started digging and found out that by using
Magento\Config\Model\PreparedValueFactory I should be able to create object with correct backend model name I have to save. Now the problem is that when I create the
PreparedValue object it doesn't have the information - the
Magento\Config\Model\Config\Structure class that's being instantiated during the
create() and is responsible for giving access to system.xml configurations doesn't have any data from said files, it's methods don't return anything.
I'm sure I'm providing correct config path to the
Factory so it's not that, it just looks like
Structure doesn't have any configurations collected during the run of
PreparedValueFactory::create(), can I do something about it or just admit defeat? Or maybe is there an easier method for saving store configs by path from upgrade scripts?